最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

如何配置docker官方源并用yum安裝docker

 更新時(shí)間:2017年07月18日 15:04:23   作者:叫我蔣樂(lè)哥哥  
本篇文章主要介紹了如何配置docker官方源并用yum安裝docker ,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文介紹了如何配置docker官方源并用yum安裝docker ,分享給大家,希望對(duì)各位有幫助

一、docker的官方安裝文檔:

https://docs.docker.com/engine/installation/linux/centos/

由docker給的文檔可以看出它也只是去配置了一個(gè)docker的yum源、然后就通過(guò)這個(gè)源來(lái)安裝docker了;在這個(gè)文檔下我們采用手工配置

的方式

二、配置一個(gè)docker用的源:

1、為docker 增加一個(gè)新的yum配置文件;touch /etc/yum.repos.d/docker.repo

touch /etc/yum.repos.d/docker.repo

2、docker.repo的內(nèi)容如下

[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=0 #我把這里設(shè)置成了0、說(shuō)明我信任了這個(gè)源,不對(duì)它的rpm進(jìn)行檢察
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://download.docker.com/linux/centos/7/source/stable
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-edge]
name=Docker CE Edge - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/edge
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-edge-debuginfo]
name=Docker CE Edge - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/edge
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-edge-source]
name=Docker CE Edge - Sources
baseurl=https://download.docker.com/linux/centos/7/source/edge
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test-debuginfo]
name=Docker CE Test - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=https://download.docker.com/linux/centos/7/source/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

三、安裝docker:

sudo yum install docker-ce
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 0:17.03.1.ce-1.el7.centos will be installed
--> Processing Dependency: docker-ce-selinux >= 17.03.1.ce-1.el7.centos for package: docker-ce-17.03.1.ce-1.el7.centos.x86_64
--> Running transaction check
---> Package docker-ce-selinux.noarch 0:17.03.1.ce-1.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
 Package             Arch         Version                Repository            Size
=====================================================================================================================================
Installing:
 docker-ce            x86_64        17.03.1.ce-1.el7.centos        docker-ce-stable         19 M
Installing for dependencies:
 docker-ce-selinux        noarch        17.03.1.ce-1.el7.centos        docker-ce-stable         28 k

Transaction Summary
=====================================================================================================================================
Install 1 Package (+1 Dependent package)

Total download size: 19 M
Installed size: 19 M
Is this ok [y/d/N]: y

四、直接下載rpm包的方式來(lái)安裝:

1、我在安裝docker的時(shí)候發(fā)現(xiàn)下載的速度只有3kB/s 然而文件大小有19M;就在我感覺(jué)安裝無(wú)望的時(shí)候、我機(jī)智的想到了自己直接把rpm下載下來(lái)

看了下docker.repo 、發(fā)現(xiàn)centos7的源地址是 https://download.docker.com/linux/centos/7/$basearch/stable 所以我只要去

https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

用迅雷(我是會(huì)員有加速)把rpm包下載下來(lái)就行了

下載如下文件:

docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm
docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm

五、安裝docker: 

ll
total 19096
-rwxrwxrwx 1 jianglexing jianglexing 19521288 May 30 20:05 docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm
-rw-r--r-- 1 jianglexing jianglexing  29108 May 30 20:15 docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm
[root@workstudio docker]# yum localinstall *
Loaded plugins: fastestmirror, langpacks
Examining docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm: docker-ce-17.03.0.ce-1.el7.centos.x86_64
Marking docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm to be installed
Examining docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm: docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch
Marking docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 0:17.03.0.ce-1.el7.centos will be installed
---> Package docker-ce-selinux.noarch 0:17.03.0.ce-1.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
 Package         Arch     Version             Repository                        Size
=====================================================================================================================================
Installing:
 docker-ce        x86_64    17.03.0.ce-1.el7.centos     /docker-ce-17.03.0.ce-1.el7.centos.x86_64        65 M
 docker-ce-selinux    noarch    17.03.0.ce-1.el7.centos     /docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch    43 k

Transaction Summary
=====================================================================================================================================
Install 2 Packages

Total size: 65 M
Installed size: 65 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch                                 1/2 
setsebool: SELinux is disabled.
libsemanage.semanage_direct_install_info: Overriding docker module at lower priority 100 with module at priority 400.
 Installing : docker-ce-17.03.0.ce-1.el7.centos.x86_64                                     2/2 
 Verifying : docker-ce-17.03.0.ce-1.el7.centos.x86_64                                     1/2 
 Verifying : docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch                                 2/2 

Installed:
 docker-ce.x86_64 0:17.03.0.ce-1.el7.centos          docker-ce-selinux.noarch 0:17.03.0.ce-1.el7.centos          

Complete!

六、啟動(dòng)docker: 

[root@workstudio docker]# systemctl start docker
[root@workstudio docker]# ps -ef | grep docker
root    4458   1 1 20:22 ?    00:00:00 /usr/bin/dockerd
root    4465  4458 0 20:22 ?    00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root    4589  4333 0 20:22 pts/1  00:00:00 grep --color=auto docker

七、測(cè)試docker是否能成功運(yùn)行: 

[root@workstudio docker]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest

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/

如下是第一次運(yùn)行hello-world 這個(gè)docker-image 由于它還不存在于本地、所以要下載它、這可能要用一點(diǎn)時(shí)間!

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • docker Compose部署springboot+vue前端端分離

    docker Compose部署springboot+vue前端端分離

    本文主要介紹了docker Compose部署springboot+vue前端端分離,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-08-08
  • IDEA遠(yuǎn)程連接Docker的流程步驟

    IDEA遠(yuǎn)程連接Docker的流程步驟

    這篇文章主要介紹了IDEA遠(yuǎn)程連接Docker的流程步驟,文中通過(guò)代碼示例給大家介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)IDEA遠(yuǎn)程連接Docker有一定的幫助,需要的朋友可以參考下
    2024-10-10
  • 查找每個(gè)Docker鏡像的層和層大小的兩種方法

    查找每個(gè)Docker鏡像的層和層大小的兩種方法

    本文主要介紹了查找每個(gè)Docker鏡像的層和層大小的兩種方法,這對(duì)于識(shí)別可能導(dǎo)致鏡像整體大小的大型層,以及確定哪些層可以被刪除或優(yōu)化以減少鏡像的大小是非常有用的,感興趣的可以了解一下
    2023-10-10
  • docker保存鏡像到本地并加載本地鏡像文件詳解

    docker保存鏡像到本地并加載本地鏡像文件詳解

    平常我們下載docker鏡像會(huì)通過(guò)配置國(guó)內(nèi)源來(lái)加速下載,但是有時(shí)候會(huì)有另外的需求,比如某個(gè)機(jī)器不能聯(lián)網(wǎng),我們就需要從其他機(jī)器下載,打包后,拷貝到這個(gè)機(jī)器,下面這篇文章主要給大家介紹了關(guān)于docker保存鏡像到本地并加載本地鏡像文件的相關(guān)資料,需要的朋友可以參考下
    2022-08-08
  • 在CentOS啟動(dòng)時(shí)自動(dòng)加載內(nèi)核模塊overlayfs操作

    在CentOS啟動(dòng)時(shí)自動(dòng)加載內(nèi)核模塊overlayfs操作

    這篇文章主要介紹了在CentOS啟動(dòng)時(shí)自動(dòng)加載內(nèi)核模塊overlayfs操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-11-11
  • docker部署redis的具體實(shí)現(xiàn)

    docker部署redis的具體實(shí)現(xiàn)

    在開(kāi)發(fā)中,我們經(jīng)常會(huì)遇到使用redis的場(chǎng)景,本文主要介紹了docker部署redis的具體實(shí)現(xiàn),具有一定的參考價(jià)值,感興趣的可以了解一下
    2024-06-06
  • 使用Docker容器部署MongoDB并支持遠(yuǎn)程訪問(wèn)及遇到的坑

    使用Docker容器部署MongoDB并支持遠(yuǎn)程訪問(wèn)及遇到的坑

    MongoDB是一個(gè)介于關(guān)系數(shù)據(jù)庫(kù)和非關(guān)系數(shù)據(jù)庫(kù)之間的產(chǎn)品,是非關(guān)系數(shù)據(jù)庫(kù)當(dāng)中功能最豐富,最像關(guān)系數(shù)據(jù)庫(kù)的,今天通過(guò)本文給大家介紹使用Docker容器部署MongoDB并支持遠(yuǎn)程訪問(wèn)及遇到的坑,感興趣的朋友一起看看吧
    2022-07-07
  • docker安裝使用系列之交叉編譯詳解

    docker安裝使用系列之交叉編譯詳解

    在x86平臺(tái)上使用Docker實(shí)現(xiàn)跨平臺(tái)編譯ARM端程序,需要安裝Docker,拉取包含ARM工具鏈的鏡像,啟動(dòng)QEMU支持,并使用相應(yīng)的Dockerfile進(jìn)行構(gòu)建,構(gòu)建完成后,可以運(yùn)行并測(cè)試ARM程序,導(dǎo)出所需文件,若在ARM平臺(tái)運(yùn)行x86鏡像,需使用Rosetta2等工具
    2024-10-10
  • cordon節(jié)點(diǎn)drain驅(qū)逐節(jié)點(diǎn)delete節(jié)點(diǎn)詳解

    cordon節(jié)點(diǎn)drain驅(qū)逐節(jié)點(diǎn)delete節(jié)點(diǎn)詳解

    這篇文章主要為大家介紹了cordon節(jié)點(diǎn)drain驅(qū)逐節(jié)點(diǎn)delete節(jié)點(diǎn)詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-11-11
  • docker?掛載、修改文件的步驟

    docker?掛載、修改文件的步驟

    這篇文章主要介紹了docker?掛載、修改文件的步驟,咱們使用的是docker的 copy 命令從容器中 copy 出來(lái)相關(guān)的配置文件,在本地修改,修改完畢在使用docker的 copy 命令從本地 copy 到容器中,重啟容器生效的,需要的朋友可以參考下
    2023-03-03

最新評(píng)論

原平市| 金山区| 柳河县| 姚安县| 永清县| 阳泉市| 连城县| 会理县| 江口县| 苍南县| 浏阳市| 泰安市| 古交市| 平昌县| 黄梅县| 兴业县| 彰化县| 仪征市| 海林市| 聂荣县| 晴隆县| 武宣县| 临江市| 田东县| 房山区| 泰和县| 拉萨市| 资源县| 台北市| 枣阳市| 日喀则市| 安多县| 临漳县| 广州市| 崇礼县| 牟定县| 上饶县| 柞水县| 东台市| 永兴县| 比如县|