阿里云centos7.5 安装docker
# hostnamectl set-hostname docker
关闭selinux和防火墙
下载docker yum源
# curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
或者下载docker-ce的rpm包
# wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/docker-ce-18.06.0.ce-3.el7.x86_64.rpm
安装依赖
# yum -y install yum-utils device-mapper-persistent-data lvm2
# yum -y install docker-ce
# systemctl enable docker.service
# systemctl start docker.service
# docker version
#################################
redhat7.5 安装docker
内核版本要求高于3.10
# yum -y install yum-utils device-persistent-data lvm2
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# ls /etc/yum.repos.d/
# yum -y install docker-ce
# systemctl enable docker.service && systemctl start docker.service
# ps aux|grep docker && docker version
#################################
mac os 安装docker
ubuntu18.04 安装docker
aws安装docker
windows10企业版安装docker
windows2016企业版安装docker
#################################
用Docker快速部署一个Web服务(wordpress)
[root@node1 ~]# mkdir -p /www/wp && cd /www/wp
[root@node1 wp]# vim docker-compose.yaml
安装docker-compose命令
https://github.com/docker/compose/releases
# curl -L https://github.com/docker/compose/releases/download/1.23.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
[root@node1 wp]# docker-compose
[root@node1 wp]# docker-compose version
docker-compose version 1.23.1, build b02f1306
docker-py version: 3.5.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f 25 May 2017
防止端口占用,先停掉所有容器
[root@node1 wp]# docker stop $(docker ps -a -q)
[root@node1 wp]# docker-compose up
后台运行
[root@node1 wp]# docker-compose up -d
浏览器访问
http://192.168.80.101:8080
即到了worldpress的安装界面
配置的帐号密码信息都在docker-compose.yaml文件中
安装完成。
http://192.168.80.101:8080/wp-admin/