centos7 docker部署

前言

Docker 要求 CentOS系統(tǒng)的內(nèi)核版本高于 3.10, 通過 uname -r 命令查看你當(dāng)前的內(nèi)核版本

安裝

yum update -y

yum -y install docker

若要安裝最新版本,可執(zhí)行

curl -fsSL https://get.docker.com/ | sh

systemctl start docker

ps:若安裝過程出現(xiàn)以下類似錯(cuò)誤,是因?yàn)橄到y(tǒng)的python版本升級(jí)導(dǎo)致.

找到對(duì)應(yīng)的文件,如/usr/bin/yum

所有的python版本一般在/usr/bin/目錄下,也可用whereis python查看

配置國(guó)內(nèi)鏡像源

ps:docker安裝好后默認(rèn)沒有此文件,需要手動(dòng)創(chuàng)建,添加阿里云鏡像節(jié)點(diǎn),并指定docker存儲(chǔ)目錄

vim /etc/docker/daemon.json

{

"registry-mirrors" :[

????"http://ovfftd6p.mirror.aliyuncs.com",

????"http://registry.docker-cn.com",

????"http://docker.mirrors.ustc.edu.cn",

????"http://hub-mirror.c.163.com"

],

????"insecure-registries" : [

????????"registry.docker-cn.com",

????????"docker.mirrors.ustc.edu.cn"

]

}

啟動(dòng)docker,并加入開機(jī)啟動(dòng)

systemctl start docker

systemctl enable docker

測(cè)試

下載hello-world鏡像

docker pull hello-world

運(yùn)行hello-world鏡像

docker run hello-world


原文鏈接:?http://world.eu-share.com/technology/135000

相關(guān)文章

docker部署php-fpm,nginx,mysql

推薦:?浮生無事的博客

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容