ubuntu下docker 安装

本文详细介绍了如何在乌版图16.04系统中安装Docker并验证其是否正常工作。包括使用命令行进行安装、启动Docker服务以及通过运行示例镜像确认安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

乌版图16.04下安装 docker,要求已经连接上网络。
终端下输入
docker version
然后终端会提醒你输入
sudo apt install docker.io
提示您希望继续执行吗? [Y/n]
输入y
等待安装完毕后
输入 sudo su
或者进入root账户,若是还没有建立管理员账户,则输入sudo passwd root然后输入密码先建立root管理员账户。
再输入一次docker version
若出现如下信息,则表示安装成功
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   78d1802
 Built:        Tue Jan 31 23:35:14 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   78d1802
 Built:        Tue Jan 31 23:35:14 2017
 OS/Arch:      linux/amd64
若是在普通用户模式下输入docker version,则只显示
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   78d1802
 Built:        Tue Jan 31 23:35:14 2017
 OS/Arch:      linux/amd64
好的,docker安装成功。
然后打开新的终端,在普通用户模式下输入
# 安装结束 打开 docker服务
$ sudo service docker start
系统会提示你输入密码,然后输入
# 验证安装
$ sudo docker run hello-world
首次输入时会先出现如下信息
Unable to find image 'hello-world:latest' locally#意思就是当地没有,然后他会自自动在网上搜索。
如出现如下信息,则表示安装的docker可以正常使用。


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.
 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://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
好的docker安装完毕,恭喜你!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值