国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

在CentOS 7上安裝Docker環(huán)境的方法與注意事項

2019-11-02 16:11:35
字體:
來源:轉載
供稿:網友

官網文檔:https://docs.docker.com/engine/installation/linux/centos/ ,本文大部分是照搬官方文檔寫的,如果你英文還不錯,那么就直接移步官方文檔吧,如果你英文實在是不行,那就勉強看一下本人這生澀的翻譯~

以下操作均在root用戶下完成

docker的安裝要求64位系統(tǒng)且內核版本大于3.10。所以如果是centos的話,必須安裝CentOS7.0或以上版本。

我們這里使用的是CentOS7.2 mininul。

uname -r

3.10.0-327.28.3.el7.x86_64

安裝docker前執(zhí)行一下全系統(tǒng)的軟件版本升級:

yum -y update

1.配置yum軟件庫

為保證安裝的成功,首先使用yum update更新Yum包,表示我的好多yum包都需要更新,1500+的包,如果你像我一樣好久沒有更新過,那就耐心等候吧。

然后在yum軟件庫中新增docker的配置:

# tee /etc/yum.repos.d/docker.repo <<-'EOF'[dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/7/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpgEOF

2.安裝Docker

有了yum軟件庫的配置之后,安裝也變得異常的簡單,只需要以下一句即可:

# yum install docker-engine

3.啟動Docker

一切就緒之后,使用start命令來啟動Docker守護進程:

# service docker start

4.輸出hello-world

程序員貌似跟hello-world有仇,有事兒沒事就打印人家一下,玩docker咱們當前也不例外,先來個hello-world吧,這里的基本原理是利用人家已經寫好的hello-world鏡像,下載到本地,然后把他運行起來~

使用以下命令:

# docker run hello-world

然后控制端會輸出類似于如下的信息,就證明我們的docker環(huán)境安裝成功了~

在這里,我第一次失敗了~顯示:

Unable to find image 'hello-world:latest' locallydocker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: net/http: TLS handshake timeout.See 'docker run --help'.

然后我又來了一次就好了,應該是墻的原因吧,看著是網絡訪問失敗了~

Unable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-worldc04b14da8d14: Pull complete Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9Status: Downloaded newer image for hello-world:latestHello 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 bashShare images, automate workflows, and more with a free Docker Hub account: https://hub.docker.comFor more examples and ideas, visit: https://docs.docker.com/engine/userguide/
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 富锦市| 梁山县| 定陶县| 定兴县| 延吉市| 涟水县| 新竹县| 措美县| 炉霍县| 隆德县| 香河县| 临城县| 沙湾县| 阿坝县| 交城县| 轮台县| 岳阳市| 图片| 北流市| 海林市| 桃园县| 察哈| 拜城县| 施秉县| 澎湖县| 巴林左旗| 迭部县| 邯郸市| 昌平区| 喀什市| 株洲市| 连城县| 临安市| 思茅市| 巩义市| 博湖县| 竹北市| 定日县| 盈江县| 嵩明县| 衡南县|