centos7中怎么安装及配置Docker
这篇文章主要介绍“centos7中怎么安装及配置Docker”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“centos7中怎么安装及配置Docker”文章能帮助大家解决问题。
cat/etc/redhat-releaseCentOSLinuxrelease7.4.1708(Core)第二步,yum安装gcc相关
确定centos7可以上外网yum-yinstallgccyum-yinstallgcc-c++安装完成之后,查看gcc版本gcc-vUsingbuilt-inspecs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapperTarget:x86_64-redhat-linuxConfiguredwith:../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-linuxThreadmodel:posixgccversion4.8.520150623(RedHat4.8.5-28)(GCC)第三步,卸载旧版本
sudoyumremovedocker\docker-client\docker-client-latest\docker-common\docker-latest\docker-latest-logrotate\docker-logrotate\docker-engine
\是连接符
第四步,安装需要的软件包sudoyuminstall-yyum-utils\device-mapper-persistent-data\lvm2第五步设置stable镜像库
#官方推荐sudoyum-config-manager\--add-repo\https://download.docker.com/linux/centos/docker-ce.repo#实际推荐sudoyumyum-config-manager--add-repohttp://mirrors.aliyun.com/cloer-re/linux/centos/docker-re.repo第六步更新yum软件包索引
yummakecachefast第七步安装docker ce
#官网sudoyum-yinstalldocker-cedocker-ce-clicontainerd.io#尚硅谷yum-yinstalldocker-ce第八步启动docker
sudosystemctlstartdocker第九步测试
dockerversiondocerrunhello-world第十步配置镜像加速
sudomkdir-p/etc/dockersudotee/etc/docker/daemon.json#daemon.json中的内容{"registry-mirrors":["https://eu2u8bif.mirror.aliyuncs.com"]}#重新加载daemon.jsonsudosystemctldaemon-reload#重启dockersudosystemctlrestartdocker第十一步卸载
#停止dockersystemctlstopdocker#移除dockersudoyum-yremovedocker-ce#移除所有容器/镜像/数据卷sudorm-rf/var/lib/docker
关于“centos7中怎么安装及配置Docker”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。