Docker安装

安装

安装方法1 自动安装
curl -sSL https://get.daocloud.io/docker | sh

安装方法2
yum安装 从高到低列出Docker-ce的版本
yum list docker-ce.x86_64  --showduplicates | sort -r  

安装方法3(建议使用这种方法安装)
yum install -y epel-release
yum install docker-io   

# 安装docker

chkconfig docker on     

# 加入开机启动

service docker start     

# 启动docker服务


# 开机自启
sudo systemctl enable docker 
# 启动docker服务  
sudo systemctl start docker


Docker 使用

实例:hello world
[root@hadoop2 opt]# docker image pull library/hello-world
Using default tag: latest
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323
Status: Downloaded newer image for docker.io/hello-world:latest
[root@hadoop2 opt]# docker image ls
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
docker.io/hello-world   latest              bf756fb1ae65        11 months ago       13.3 kB

posted on 2021-01-07 15:19  shumeigang  阅读(82)  评论(0编辑  收藏  举报

导航