//centos7安装docker-ce
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
sytemctl enable docker
systemctl start docker
//mysql
docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=root -e TZ="Asia/Shanghai" -d mysql:5.5.62
//mongodb
docker pull mongo:3.7.9
docker run -itd --name mongo -p 27017:27017 mongo:3.7.9 --auth
docker exec -it mongo mongo admin
db.createUser({ user:'admin',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'}]});
db.auth('admin', '123456')
db.createUser({ user:'yapi_user',pwd:'1',roles:[ { role:'readWrite', db: 'yapi'}]});
//nginx
docker run -p 80:80 --name nginx -v /home/shan/dev/nginx/docker-volume/log:/var/log/nginx -v /home/shan/dev/nginx/docker-volume/conf/nginx.conf:/etc/nginx/nginx.conf -v /home/shan/dev/nginx/docker-volume/conf.d:/etc/nginx/conf.d -v /home/shan/dev/nginx/docker-volume/html:/usr/share/nginx/html -d nginx:1.16.1
//shadowsocks
docker run -e PASSWORD=111111 -p 400:8388 --name ss -d shadowsocks/shadowsocks-libev
//transmission
docker create -p 9091:9091 -p 51413:51413 -e USER=username -e PASS=password -v ~/bt:/downloads --name=transmission --restart linuxserver/transmission
// seafile
docker run -d --name seafile -e SEAFILE_SERVER_HOSTNAME=192.168.1.105 -v /seafile_data:/shared -p 8888:80 seafileltd/seafile:6.3.4
//nexus3
docker run -d -p 8081:8081 -p 8082:8082 -p 8083:8083 --name nexus sonatype/nexus3
//centos
docker run -d --name my_centos --privileged centos:7.7.1908 /sbin/init
docker exec -i -t my_centos /bin/bash
//修改时区
mv /etc/localtime /etc/localtime.bak
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
//alpine修改时区
apk add tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone
//阿里云镜像
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
//centos 安装中文
yum install kde-l10n-Chinese
//创建网络
docker network create my_net
docker run -d --name my_centos --privileged --network my_net --network-alias my_centos centos:7.7.1908 /sbin/init
//发布镜像
sudo docker commit -m="test" -a="sjl" 0a02eb76bd96 dmshan88/test_zabbix_agent:v1
docker
最新推荐文章于 2024-07-23 16:56:06 发布