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

Docker 安裝及配置鏡像加速的實(shí)現(xiàn)

 更新時(shí)間:2021年01月28日 09:45:03   作者:哈嘍沃德先生  
這篇文章主要介紹了Docker 安裝及配置鏡像加速的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

Docker 版本

  隨著 Docker 的飛速發(fā)展,企業(yè)級(jí)功能的上線,更好的服務(wù)意味著需要支付一定的費(fèi)用,目前 Docker 被分為兩個(gè)版本:

  • community-edition 社區(qū)版
  • enterprise-edition 企業(yè)版

  Docker 企業(yè)版(EE)專為企業(yè)開發(fā)和 IT 團(tuán)隊(duì)設(shè)計(jì),可在大規(guī)模生產(chǎn)中構(gòu)建,運(yùn)送和運(yùn)行關(guān)鍵業(yè)務(wù)應(yīng)用程序。Docker EE 集成,認(rèn)證和支持,為企業(yè)提供業(yè)界最安全的容器平臺(tái),實(shí)現(xiàn)所有應(yīng)用程序的現(xiàn)代化。作為一個(gè)以應(yīng)用為中心的平臺(tái),Docker EE 旨在加速和保護(hù)整個(gè)軟件供應(yīng)鏈,從開發(fā)到在任何基礎(chǔ)設(shè)施上運(yùn)行的生產(chǎn)。

  我們學(xué)習(xí) Docker 使用 CE 社區(qū)版即可。

在 CentOS 上安裝 Docker 引擎

  Docker 支持 Mac Windows Linux,本文使用 Linux 環(huán)境教大家如何基于 CentOS 安裝 Docker 及配置鏡像加速。

  官方文檔:https://docs.docker.com/

系統(tǒng)要求

  官網(wǎng)提示如果要安裝 Docker Engine,您需要一個(gè) CentOS 7 以及以上的穩(wěn)定版本。

卸載舊版本

  較舊的 Docker 版本為 dockerdocker-engine。 如果已安裝這些程序,請(qǐng)卸載它們以及相關(guān)的依賴項(xiàng)。

sudo yum remove docker \
     docker-client \
     docker-client-latest \
     docker-common \
     docker-latest \
     docker-latest-logrotate \
     docker-logrotate \
     docker-engine

Docker 鏡像、容器、數(shù)據(jù)卷和網(wǎng)絡(luò)數(shù)據(jù)都保存在 /var/lib/docker/。新的 Docker 引擎包現(xiàn)在為 Docker-ce。

設(shè)置 yum 源

  安裝 yum-utils 軟件包(提供了 yum-config-manager 程序)并設(shè)置穩(wěn)定的 yum 源方便下載 Docker Engine。

# 安裝 yum-utils
sudo yum install -y yum-utils
# 設(shè)置 yum 源為阿里云方便下載 Docker Engine
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Docker 安裝

  安裝最新版本的 Docker Engine 和容器。

sudo yum install docker-ce docker-ce-cli containerd.io

安裝過程中如果提示您接受 GPG 密鑰,請(qǐng)驗(yàn)證指紋是否與 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 匹配,如果是,請(qǐng)接受。

Docker 的啟動(dòng)與停止

# 啟動(dòng) docker
sudo systemctl start docker
# 停止 docker
sudo systemctl stop docker
# 重啟 docker
sudo systemctl restart docker
# 設(shè)置開機(jī)啟動(dòng)
sudo systemctl enable docker
# 查看 docker 狀態(tài)
sudo systemctl status docker
# 查看 docker 內(nèi)容器的運(yùn)行狀態(tài)
sudo docker stats
# 查看 docker 概要信息
sudo docker info
# 查看 docker 幫助文檔
sudo docker --help

安裝校驗(yàn)

[root@localhost ~]# docker -v
Docker version 19.03.12, build 48a66213fe
[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:   19.03.12
 API version:  1.40
 Go version:  go1.13.10
 Git commit:  48a66213fe
 Built:    Mon Jun 22 15:46:54 2020
 OS/Arch:   linux/amd64
 Experimental:  false

Server: Docker Engine - Community
 Engine:
 Version:   19.03.12
 API version:  1.40 (minimum version 1.12)
 Go version:  go1.13.10
 Git commit:  48a66213fe
 Built:   Mon Jun 22 15:45:28 2020
 OS/Arch:   linux/amd64
 Experimental:  false
 containerd:
 Version:   1.2.13
 GitCommit:  7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
 Version:   1.0.0-rc10
 GitCommit:  dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
 Version:   0.18.0
 GitCommit:  fec3683

配置鏡像加速

  Docker 從 Docker Hub 拉取鏡像,因?yàn)槭菑膰猥@取,所以速度較慢,會(huì)出現(xiàn)以下情況:

[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: net/http: TLS handshake timeout.
See 'docker run --help'.

  可以通過配置國內(nèi)鏡像源的方式,從國內(nèi)獲取鏡像,提高拉取速度。這里介紹中國科學(xué)技術(shù)大學(xué)(LUG@USTC)的開源鏡像:https://docker.mirrors.ustc.edu.cn 和網(wǎng)易的開源鏡像:http://hub-mirror.c.163.com

  USTC 是老牌的 Linux 鏡像服務(wù)提供者了,USTC 的 Docker 鏡像加速服務(wù)速度很快。USTC 和網(wǎng)易的優(yōu)勢(shì)之一就是不需要注冊(cè),屬于真正的公共服務(wù)。(也可以使用阿里等其他服務(wù)商的鏡像加速服務(wù))

  編輯文件 daemon.json 。

vi /etc/docker/daemon.json

  在文件中輸入以下內(nèi)容并保存。

{
 "registry-mirrors": ["http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn"]
}

  重新加載配置信息及重啟 Docker 服務(wù)。

# 重新加載某個(gè)服務(wù)的配置文件
sudo systemctl daemon-reload
# 重新啟動(dòng) docker
sudo systemctl restart docker

hello-world

  通過運(yùn)行 hello-world 鏡像來驗(yàn)證 Docker Engine 是否已正確安裝。

[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally # 本地找不到 hello-world 鏡像
latest: Pulling from library/hello-world # 拉取最新版本的 hello-world 鏡像
0e03bdcc26d7: Pull complete 
Digest: sha256:49a1c8800c94df04e9658809b006fd8a686cab8028d33cfba2cc049724254202
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.
 (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/

  docker run hello-world 命令執(zhí)行流程圖如下。

通過以上步驟大家已完成 Docker 安裝的所有工作,接下來通過學(xué)習(xí)鏡像命令和容器命令更加熟悉 Docker 的使用。

到此這篇關(guān)于Docker 安裝及配置鏡像加速的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)Docker 安裝及鏡像加速內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • docker覆蓋鏡像默認(rèn)命令之docker?entrypoint詳解

    docker覆蓋鏡像默認(rèn)命令之docker?entrypoint詳解

    entrypoint命令就是覆蓋ENTRYPOINT命令的,本文給大家介紹了docker覆蓋鏡像默認(rèn)命令之docker?entrypoint的相關(guān)知識(shí),需要的朋友可以參考下
    2023-10-10
  • 解決Docker Image鏡像無法刪除問題的方法

    解決Docker Image鏡像無法刪除問題的方法

    這篇文章主要給大家介紹了關(guān)于如何解決Docker Image鏡像無法刪除問題的方法,文中通過示例代碼將解決的方法介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-01-01
  • 使用docker更改容器內(nèi)root密碼的操作

    使用docker更改容器內(nèi)root密碼的操作

    這篇文章主要介紹了使用docker更改容器內(nèi)root密碼的操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2021-03-03
  • Docker 制作鏡像Dockerfile和commit操作

    Docker 制作鏡像Dockerfile和commit操作

    這篇文章主要介紹了Docker 制作鏡像Dockerfile和commit操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-11-11
  • idea鏈接不上虛擬機(jī)的docker里的mongodb問題及解決

    idea鏈接不上虛擬機(jī)的docker里的mongodb問題及解決

    這篇文章主要介紹了idea鏈接不上虛擬機(jī)的docker里的mongodb問題及解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-06-06
  • Docker安裝php及yaf擴(kuò)展文件內(nèi)容

    Docker安裝php及yaf擴(kuò)展文件內(nèi)容

    這篇文章主要為大家介紹了Docker安裝php及yaf擴(kuò)展文件內(nèi)容,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-11-11
  • Docker數(shù)據(jù)卷掛載命令volume(-v)與mount的使用總結(jié)

    Docker數(shù)據(jù)卷掛載命令volume(-v)與mount的使用總結(jié)

    本文主要介紹了Docker數(shù)據(jù)卷掛載命令volume(-v)與mount的使用總結(jié),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-08-08
  • Docker部署Nginx并配置反向代理

    Docker部署Nginx并配置反向代理

    這篇文章介紹了Docker部署Nginx并配置反向代理的方法,對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-01-01
  • Docker-Compose實(shí)現(xiàn)Mysql主從的示例代碼

    Docker-Compose實(shí)現(xiàn)Mysql主從的示例代碼

    本文主要介紹了Docker-Compose實(shí)現(xiàn)Mysql主從的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-06-06
  • Docker無法stop或者rm指定容器問題解決方案

    Docker無法stop或者rm指定容器問題解決方案

    這篇文章主要介紹了Docker無法stop或者rm指定容器問題解決方案,本文給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧
    2024-06-06

最新評(píng)論

绥芬河市| 常德市| 新竹市| 南昌市| 濮阳县| 个旧市| 黎川县| 华池县| 黎城县| 全椒县| 德化县| 清涧县| 康定县| 淮南市| 乌鲁木齐县| 汝州市| 彰武县| 永寿县| 孟津县| 枣阳市| 焉耆| 固始县| 西和县| 卓尼县| 翼城县| 安溪县| 麻城市| 泽普县| 平谷区| 平邑县| 东乡| 宁夏| 铁岭县| 建昌县| 普洱| 延安市| 炉霍县| 自治县| 庆城县| 朔州市| 思茅市|