| 本文教你如何在 CentOS 7 及以上版本進行 docker 安裝。 |
cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
確定centos7可以上外網 yum -y install gcc yum -y install gcc-c++
安裝完成之后,查看gcc版本 gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
\是連接符
sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
# 官方推薦 sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo # 實際推薦 sudo yum yum-config-manager --add-repo http://mirrors.aliyun.com/cloer-re/linux/centos/docker-re.repo
yum makecache fast
# 官網 sudo yum -y install docker-ce docker-ce-cli containerd.io # 尚硅谷 yum -y install docker-ce
sudo systemctl start docker
docker version docer run hello-world
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json
# daemon.json中的內容
{
"registry-mirrors": ["https://eu2u8bif.mirror.aliyuncs.com"]
}
# 重新加載daemon.json
sudo systemctl daemon-reload
# 重啟docker
sudo systemctl restart docker
# 停止docker systemctl stop docker # 移除docker sudo yum -y remove docker-ce # 移除所有容器/鏡像/數據卷 sudo rm -rf /var/lib/docker
原文地址: https://www.linuxprobe.com/centos7-docker.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。