赞
踩
mkdir -p /docker/redis
mkdir -p /docker/redis/data
touch /docker/redis/redis.conf
touch /docker/redis/redis.bash
# Redis配置文件
# Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程
daemonize no
# 指定Redis监听端口,默认端口为6379
port 6379
# 绑定的主机地址,不要绑定容器的本地127.0.0.1地址,因为这样就无法在容器外部访问
bind 0.0.0.0
#需要密码则打开
requirepass admin
# 持久化
appendonly yes
docker run -p 6379:6379 --name redis -v /docker/redis/redis.conf:/etc/redis/redis.conf -v /docker/redis/data:/data -d redis redis-server /etc/redis/redis.conf
sudo chmod 777 /docker/redis/redis.bash
# 创建挂载目录
mkdir -p /docker/nginx/conf
mkdir -p /docker/nginx/log
mkdir -p /docker/nginx/html
touch /docker/nginx/nginx.bash
# 生成容器
docker run --name nginx -p 9001:80 -d nginx
# 将容器nginx.conf文件复制到宿主机
docker cp nginx:/etc/nginx/nginx.conf /docker/nginx/conf/nginx.conf
# 将容器conf.d文件夹下内容复制到宿主机
docker cp nginx:/etc/nginx/conf.d /docker/nginx/conf/conf.d
# 将容器中的html文件夹复制到宿主机
docker cp nginx:/usr/share/nginx/html /docker/nginx/
# 直接执行docker rm nginx或者以容器id方式关闭容器
# 找到nginx对应的容器id
docker ps -a
# 关闭该容器
docker stop nginx
# 删除该容器
docker rm nginx
# 删除正在运行的nginx容器
docker rm -f nginx
docker run -p 8081:80 --name nginx -v /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /docker/nginx/conf/conf.d:/etc/nginx/conf.d -v /docker/nginx/log:/var/log/nginx -v /docker/nginx/html:/usr/share/nginx/html -d nginx:latest
sudo chmod 777 /docker/nginx/nginx.bash
docker pull mongo:4.2
docker run -d --name mongo --restart=always --privileged=true -p 27017:27017 -v /home//mongodb/data:/data/db mongo:4.2 --auth
docker exec -it mongo mongo admin
db.createUser({user:'admin',pwd:'admin123',roles:[{role:'userAdminAnyDatabase',db:'admin'},'readWriteAnyDatabase']});
docker pull jenkins/jenkins:2.426.2
docker run --name jenkins -u root --rm -d -p 8080:8080 -p 50000:50000 -v /docker/ygame:/docker/ygame -v /var/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime -v /var/run/docker.sock:/var/run/docker.sock jenkins/jenkins
docker cp /root/maven jenkins:/opt
maven,Publish Over SSH ,gitee
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。