docker安装
yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
yum install docker-ce -y
systemctl start docker
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ $(lsb_release -cs) stable"
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io -y
docker安装nginx
docker pull nginx
mkdir -p /root/nginx/{conf,conf.d,html,logs,ssl}
docker run --name nginx -itd nginx /bin/bash
docker cp nginx:/etc/nginx/nginx.conf /root/nginx/conf/nginx.conf
docker cp nginx:/etc/nginx/conf.d /root/nginx
docker cp nginx:/usr/share/nginx/html /root/nginx
docker cp nginx:/var/log/nginx /root/nginx/logs
docker stop nginx
docker rm nginx
docker run --name nginx -d -p 80:80 -p 443:443 -v /root/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /root/nginx/conf.d:/etc/nginx/conf.d -v /root/nginx/html:/usr/share/nginx/html -v /root/nginx/logs:/var/log/nginx -v /root/nginx/ssl:/root/ssl nginx
docker安装mysql
docker run -id --name=mysql_57 -p 3357:3306 -e MYSQL_ROOT_PASSWORD=PASSWORD mysql:5.7 --character-set-server=utf8
docker run -id --name=mysql_80 -p 3380:3306 -e MYSQL_ROOT_PASSWORD=PASSWORD mysql:8.0 --character-set-server=utf8
mkdir -p /home/mysql/data
docker run -id --name=mysql_57 -p 3357:3306 -e MYSQL_ROOT_PASSWORD=PASSWORD -v /home/mysql/data:/var/lib/mysql mysql:5.7 --character-set-server=utf8
mkdir -p /home/mysql/data
docker run -id --name=mysql_80 -p 3380:3306 -e MYSQL_ROOT_PASSWORD=PASSWORD -v /home/mysql/data:/var/lib/mysql mysql:8.0 --character-set-server=utf8
docker安装在线图形化管理
docker run -itd -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --name portainer portainer/portainer
docker部署jar
docker run -d -it -p9100-9200:9100-9200 -v /data/java/demo1:/data/java --name demo1 openjdk:8