1docker 安装与启动
sudo yum update
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce
docker ‐v
vi /etc/docker/daemon.json
{ “registry‐mirrors”: [“https://docker.mirrors.ustc.edu.cn”] }
2Docker的启动与停止
systemctl start docker
systemctl stop docker
systemctl restart docker
systemctl status docker
systemctl enable docker
docker info
docker ‐‐help
3常用命令
docker images
docker search 镜像名称
docker pull 镜像名称
docker pull centos:7
docker rmi 镜像ID
docker rmi docker images -q
docker ps
docker ps -a
docker stop 容器名称(或者容器ID)
docker start 容器名称(或者容器ID)
docker inspect 容器名称(容器ID)
4应用部署
docker pull centos/mysql-57-centos7
docker run -di --name=tensquare_mysql -p 33306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
docker pull tomcat:7-jre7
docker run -di --name=mytomcat -p 9000:8080 -v /usr/local/webapps:/usr/local/tomcat/webapps tomcat:7-jre7
docker pull nginx
docker run -di --name=mynginx -p 80:80 nginx
docker pull redis
docker run -di --name=myredis -p 6379:6379 redis
链接:https://pan.baidu.com/s/1MgjmayAF4DoEN8wC_ucLUw
提取码:t2yr
复制这段内容后打开百度网盘手机App,操作更方便哦–来自百度网盘超级会员V1的分享