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

Docker啟動失敗報(bào)錯(cuò)Failed?to?start?Docker?Application?Container?Engine的解決辦法

 更新時(shí)間:2022年08月09日 08:59:37   作者:天涯人6  
最近在啟動Docker的時(shí)候發(fā)現(xiàn)了個(gè)錯(cuò)誤,所以下面這篇文章主要給大家介紹了關(guān)于Docker啟動失敗報(bào)錯(cuò)Failed?to?start?Docker?Application?Container?Engine的解決辦法,需要的朋友可以參考下

前言

在給一臺騰訊云機(jī)器安裝docker后發(fā)現(xiàn)無法啟動,總是報(bào)錯(cuò)Failed to start Docker Application Container Engine,解決思路分享一下,以免各位童鞋踩坑。

1 安裝Docker

說明:本文僅針對Linux CentOS 7環(huán)境下進(jìn)行講解,Mac版本請?jiān)诠俜较螺dDocker.dmg安裝(留意:Macbook 沒有yum、systemctl、service等Linux系統(tǒng)的命令,建議下載dmg桌面版Docker使用、配置方便。當(dāng)然也可以brew install docker自己玩),Windows版本可以下載Docker exe安裝包。

卸載已有 Docker

如果你已經(jīng)安裝過舊版的 Docker,可以先執(zhí)行以下命令卸載舊版 Docker:

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

安裝 Docker

首次安裝 Docker 之前,需要添加 Docker 安裝源。添加之后,就可以從已經(jīng)配置好的源去 安裝和更新 Docker。添加 Docker 安裝源的命令如下:

$ sudo yum-config-manager \
? ? --add-repo \
? ? https://download.docker.com/linux/centos/docker-ce.repo

正常情況下,直接安裝最新版本的 Docker 即可,因?yàn)樽钚掳姹镜?Docker 有著更好的穩(wěn)定性和安全性。也可以使用以下命令安裝最新版本的 Docker: 

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

注意:Linux CentOS 版本可以通過uname -r 來查看,必須在3.10版本之上才可以使用新版docker。比如我機(jī)器上的是3.10.0-1160.62.1.el7.x86_64。

如果想要安裝指定版本的 Docker,可以使用以下命令查看到一批最近的docker歷史版本列表:

$ sudo yum list docker-ce --showduplicates | sort -r
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks
Installed Packages
docker-ce.x86_64            3:20.10.9-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.8-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.7-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.6-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.5-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.4-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.3-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.2-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.14-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:20.10.14-3.el7                   @docker-ce-stable
docker-ce.x86_64            3:20.10.1-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.13-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:20.10.12-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:20.10.11-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:20.10.10-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:20.10.0-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.9-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.8-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.7-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.6-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.5-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.4-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.3-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.2-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.15-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:19.03.14-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:19.03.1-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:19.03.13-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:19.03.12-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:19.03.11-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:19.03.10-3.el7                   docker-ce-stable 
docker-ce.x86_64            3:19.03.0-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.9-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.8-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.7-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.6-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.5-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.4-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.3-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.2-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.1-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:18.09.0-3.el7                    docker-ce-stable 
docker-ce.x86_64            18.06.3.ce-3.el7                   docker-ce-stable 
docker-ce.x86_64            18.06.2.ce-3.el7                   docker-ce-stable 
docker-ce.x86_64            18.06.1.ce-3.el7                   docker-ce-stable 
docker-ce.x86_64            18.06.0.ce-3.el7                   docker-ce-stable 
docker-ce.x86_64            18.03.1.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            18.03.0.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.12.1.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.12.0.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.09.1.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.09.0.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.06.2.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.06.1.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.06.0.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.03.3.ce-1.el7                   docker-ce-stable 
docker-ce.x86_64            17.03.2.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.03.1.ce-1.el7.centos            docker-ce-stable 
docker-ce.x86_64            17.03.0.ce-1.el7.centos            docker-ce-stable 

然后選取想要的版本執(zhí)行以下命令:

$ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

安裝完成后,使用以下命令啟動 Docker。

$ sudo systemctl start docker

安裝完成后,我們需要使用以下命令啟動一個(gè) hello world 的容器。

$ sudo docker run hello-world

如果看到輸出了【Hello from Docker!】則說明docker可用。

其它命令比如docker ps -a查看所有鏡像,自行學(xué)習(xí)即可。

2 Docker安裝故障FAQ

2.1 安裝Docker的版本選擇

在Linux中對不同的安裝方式產(chǎn)生的安裝目錄和文件均不相同,有的會默認(rèn)放到/sbin或/opt或/usr/local下面,配置文件一般會在/etc下面。Docker也是一樣,如果使用:

sudo yum install docker

來安裝(建議均使用root權(quán)限),則安裝的版本為1.13.1。

而如果按照上述第一節(jié)的做法,安裝docker-ce版本,則最新是Docker version 20.10.14, build a224086。建議大家安裝docker-ce版本。

2.2 啟動失敗

安裝完畢后,通過systemctl start docker啟動直接報(bào)錯(cuò):

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

從這個(gè)錯(cuò)誤看不出來什么信息,就去看下運(yùn)行狀態(tài):

systemctl status docker:

[root@VM_17_5_centos init.d]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Sun 2022-04-10 19:09:56 CST; 11s ago
     Docs: https://docs.docker.com
  Process: 14592 ExecStart=/usr/bin/dockerd --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 14592 (code=exited, status=1/FAILURE)
 
Apr 10 19:09:54 VM_17_5_centos systemd[1]: docker.service failed.
Apr 10 19:09:56 VM_17_5_centos systemd[1]: docker.service holdoff time over, scheduling restart.
Apr 10 19:09:56 VM_17_5_centos systemd[1]: Stopped Docker Application Container Engine.
Apr 10 19:09:56 VM_17_5_centos systemd[1]: start request repeated too quickly for docker.service
Apr 10 19:09:56 VM_17_5_centos systemd[1]: Failed to start Docker Application Container Engine.
Apr 10 19:09:56 VM_17_5_centos systemd[1]: Unit docker.service entered failed state.
Apr 10 19:09:56 VM_17_5_centos systemd[1]: docker.service failed.
Apr 10 19:10:00 VM_17_5_centos systemd[1]: start request repeated too quickly for docker.service
Apr 10 19:10:00 VM_17_5_centos systemd[1]: Failed to start Docker Application Container Engine.
Apr 10 19:10:00 VM_17_5_centos systemd[1]: docker.service failed.

貌似也沒發(fā)現(xiàn)什么有效的錯(cuò)誤信息,唯一的一句錯(cuò)誤是【Failed to start Docker Application Container Engine.】網(wǎng)上其它文章的如下幾個(gè)解決方案均無法生效

1)修改 /etc/docker/daemon.json添加registry-mirrors鏡像地址:這個(gè)是用于加速的,跟啟動失敗一般不會有關(guān)系。

2)刪除/etc/docker/daemon.json:根本沒必要?jiǎng)h除,用docker官網(wǎng)的鏡像太慢了,肯定要配置國內(nèi)的鏡像源的。跟啟動失敗也不會有關(guān)系。

3)修改Docker Container Engine的配置文件:

有的文章建議去修改/usr/lib/systemd/system/docker.service配置文件,個(gè)人覺得是根本沒有必要。雖說從錯(cuò)誤信息看是有【Process: 14592 ExecStart=/usr/bin/dockerd --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 14592 (code=exited, status=1/FAILURE)】這樣一句,但本質(zhì)上原生安裝包不可能剛安裝就有問題還需要用戶自己修改什么。

鑒于上述幾點(diǎn)都無法解決,就想到查看Linux系統(tǒng)操作日志(最后200行就可以排查):

tail -200f /var/log/messages

此時(shí),再次輸入systemctl start docker試圖啟動docker,發(fā)現(xiàn)如下錯(cuò)誤行:

dockerd: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: Iptables not found

這句話的意思不就是iptables命令無法找到嗎?那試圖看下,cd /sbin目錄查找iptables,竟然的確沒有,用service iptables start也會報(bào)錯(cuò):iptables: /sbin/iptables does not exist。

但是,/sbin目錄下有個(gè)iptables_.sh文件!!是哪個(gè)應(yīng)用修改了這個(gè),不得而知,直接修改:

mv iptables_  iptables,再啟動:service iptables start,成功了!

這時(shí),再啟動docker:systemctl start docker無輸出但沒報(bào)錯(cuò)了,通過systemctl status docker查看,狀態(tài)是Active狀態(tài),表示docker運(yùn)行正常了!

[root@VM_17_5_centos init.d]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2022-04-10 19:32:05 CST; 41min ago
     Docs: https://docs.docker.com
 Main PID: 16216 (dockerd)
    Tasks: 14
   Memory: 38.3M
   CGroup: /system.slice/docker.service
           └─16216 /usr/bin/dockerd --containerd=/run/containerd/containerd.sock
 
Apr 10 19:32:04 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:04.774479730+08:00" level=info msg="ccRes...=grpc
Apr 10 19:32:04 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:04.774491097+08:00" level=info msg="Clien...=grpc
Apr 10 19:32:04 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:04.800327122+08:00" level=info msg="[grap...lay2"
Apr 10 19:32:04 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:04.805695934+08:00" level=info msg="Loadi...art."
Apr 10 19:32:04 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:04.914702098+08:00" level=info msg="Defau...ress"
Apr 10 19:32:05 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:05.027046047+08:00" level=info msg="Loadi...one."
Apr 10 19:32:05 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:05.070391831+08:00" level=info msg="Docke...10.14
Apr 10 19:32:05 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:05.070498814+08:00" level=info msg="Daemo...tion"
Apr 10 19:32:05 VM_17_5_centos systemd[1]: Started Docker Application Container Engine.
Apr 10 19:32:05 VM_17_5_centos dockerd[16216]: time="2022-04-10T19:32:05.107225048+08:00" level=info msg="API l...sock"
Hint: Some lines were ellipsized, use -l to show in full.

其它FAQ疑問歡迎大家持續(xù)留言給我來匯總歸納,謝謝~~

總結(jié)

到此這篇關(guān)于Docker啟動失敗報(bào)錯(cuò)Failed to start Docker Application Container Engine解決的文章就介紹到這了,更多相關(guān)Docker啟動失敗報(bào)錯(cuò)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 30分鐘帶你了解Docker(推薦)

    30分鐘帶你了解Docker(推薦)

    這篇文章是針對Java開發(fā)人員的,但Docker的使用場景絕不僅限于此。最后,靈敏意味著可能有一些開發(fā)方式需要調(diào)整,到底如何利用Docker應(yīng)該是當(dāng)你了解它之后需要認(rèn)真思考的問題
    2018-08-08
  • 使用dockerfile構(gòu)建nginx鏡像的方法示例

    使用dockerfile構(gòu)建nginx鏡像的方法示例

    這篇文章主要介紹了使用dockerfile構(gòu)建nginx鏡像的方法示例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-09-09
  • 查找每個(gè)Docker鏡像的層和層大小的兩種方法

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

    本文主要介紹了查找每個(gè)Docker鏡像的層和層大小的兩種方法,這對于識別可能導(dǎo)致鏡像整體大小的大型層,以及確定哪些層可以被刪除或優(yōu)化以減少鏡像的大小是非常有用的,感興趣的可以了解一下
    2023-10-10
  • Docker中限制CPU和內(nèi)存的使用的方法

    Docker中限制CPU和內(nèi)存的使用的方法

    在容器化的動態(tài)世界中,Docker 已經(jīng)成為構(gòu)建、部署和管理容器化的關(guān)鍵工具應(yīng)用,設(shè)置適當(dāng)?shù)膬?nèi)存和 CPU 限制對于優(yōu)化 Docker 性能至關(guān)重要,確保每個(gè)容器在不使主機(jī)負(fù)擔(dān)過重的情況下獲得必要的資源,本文將深入探討有效設(shè)置這些限制的實(shí)用策略,需要的朋友可以參考下
    2025-01-01
  • docker容器分配固定ip的實(shí)現(xiàn)示例

    docker容器分配固定ip的實(shí)現(xiàn)示例

    如果不固定ip,每次主機(jī)重啟后,docker會動態(tài)給容器分配ip,導(dǎo)致redis容器的IP自動換了 ,然后還得去改配置就很煩,本文主要介紹了docker容器分配固定ip的實(shí)現(xiàn)示例,具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-12-12
  • Docker Desktop啟動失敗的解決(Docker failed to initialize Docker Desktop is shutting down)

    Docker Desktop啟動失敗的解決(Docker failed to i

    本文主要介紹了Docker Desktop啟動失敗的解決(Docker failed to initialize Docker Desktop is shutting down),文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-03-03
  • Docker容器編譯LNMP的實(shí)現(xiàn)示例

    Docker容器編譯LNMP的實(shí)現(xiàn)示例

    本文主要介紹了Docker容器編譯LNMP,使用Docker容器基于centos鏡像分別制作nginx鏡像,mysql鏡像和php鏡像使用編譯安裝的方式,具有一定的參考價(jià)值,感興趣的可以了解一下
    2021-12-12
  • docker中run、start和create命令的區(qū)別

    docker中run、start和create命令的區(qū)別

    對于 Docker 初學(xué)者來說,docker start、docker run 和 docker create 等術(shù)語可能會令人困惑,本文就來介紹一下docker中run、start和create命令的區(qū)別,感興趣的可以了解一下
    2023-11-11
  • Docker自動部署Apache Tomcat的方法

    Docker自動部署Apache Tomcat的方法

    這篇文章主要介紹了Docker自動部署Apache Tomcat的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-04-04
  • docker-compose 詳解及示例代碼

    docker-compose 詳解及示例代碼

    這篇文章主要介紹了docker-compose 詳解的相關(guān)資料,并附簡單實(shí)例,需要的朋友可以參考下
    2016-10-10

最新評論

长治县| 巴塘县| 丰县| 邯郸县| 上虞市| 修水县| 社会| 丹江口市| 新乡市| 滦南县| 武陟县| 额济纳旗| 宣威市| 灵寿县| 南昌县| 平昌县| 平遥县| 分宜县| 洞头县| 铜鼓县| 南乐县| 西乌珠穆沁旗| 赤水市| 南华县| 西乌| 伊金霍洛旗| 平乐县| 永登县| 息烽县| 榆中县| 宜春市| 类乌齐县| 油尖旺区| 贺州市| 尉氏县| 闽侯县| 松江区| 绥中县| 福安市| 东乡族自治县| 中牟县|