码迷,mamicode.com
首页 > 其他好文 > 详细

docker安装

时间:2020-02-07 12:43:56      阅读:62      评论:0      收藏:0      [点我收藏+]

标签:appear   hub   table   nal   plain   contain   port   head   div   

一、Docker介绍与安装

安装

官方安装文档

ubuntu下安装

如果是第一次安装,你需要先添加docker的源然后再安装

  1. 更新包

    sudo apt-get update

     

  2.  安装证书

    

sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg-agent     software-properties-common

  3. 添加docker的官方GPGkey  

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  4. 添加docker源

sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu    $(lsb_release -cs)    stable"

 

安装 docker ce

  1. 更新包索引

  sudo apt-get update

  2. 安装docker

  sudo apt-get install docker-ce

  3. 检测是否安装成功

  sudo docker run hello-world

安装成功会出现如下信息:

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

 

 

为了方便使用,不用sudo就可以运行docker命令,安装好docker后再命令行输入如下命令:

sudo usermod -aG docker $USER

 

docker安装

标签:appear   hub   table   nal   plain   contain   port   head   div   

原文地址:https://www.cnblogs.com/zhanghaibin16/p/12272333.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!