Home > Archives > 带你从零了解Docker

带你从零了解Docker

Publish:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
yum remove docker docker-common docker-selinux docker-engine -y
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum install docker-ce -y
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl daemon-reload
docker pull hello-world
docker images
docker run -it hello-world
docker ps -a

docker search php
docker pull php:5.6-fpm
docker images

mkdir -p ~/php-fpm/logs ~/php-fpm/conf
cd php-fpm/
vim Dockerfile
docker build -t php:5.6-fpm .
docker rmi 3c6963d39c34

/etc/docker/daemon.json

1
2
3
4
5
6
{
    "registry-mirrors": [
        "加速地址"
    ],
    "insecure-registries": []
}

以下是国内加速地址

Docker中国区官方镜像(http://www.docker-cn.com/registry-mirror)

https://registry.docker-cn.com

网易

http://hub-mirror.c.163.com

ustc

https://docker.mirrors.ustc.edu.cn

参考

带你从零了解Docker

声明: 本文采用 BY-NC-SA 授权。转载请注明转自: Ding Bao Guo