首页文章正文

docker安装centos7镜像,如何制作docker镜像

linux使用清华镜像源 2023-12-19 11:16 615 墨鱼
linux使用清华镜像源

docker安装centos7镜像,如何制作docker镜像

docker安装centos7镜像,如何制作docker镜像

systemctlenabledocker//拉取指定版本的CentOS镜像dockerpullcentos:centos7//运行容器dockerrun-itd--namecentos-testcentos:centos7//新建1.拉取指定版本的CentOS镜像,这里以安装指定版本(centos7)为例:dockerpullcentos:centos712。检查本地镜像是否安装成功。使用使用以下命令检查centos7是否已安装:do

$dockerpullcentos:centos73.检查本地镜像并使用以下命令检查centos7是否已安装:$dockerimages4.运行容器,即可通过exec命令进入CentOS容器。 dockerDockerinstallDocker并获取镜像。使用刚刚获取的centos镜像,创建一个容器,在容器中运行bash并应用Docker。创建镜像并写入Dockerfile文件。第二个修改是修改现有镜像并在容器中本地启动它。

需要确认ExtraPackagesforEnterpriseLinux(EPEL)安装源已经启动。如果没有启动,需要手动启动。Incentos6.9,安装源默认启动。可以使用yumrepolist启动centos7镜像。如果不指定/bin/bash,运行[root@localhost~]#dockerrun-d-i-t/bin/bash后容器会自动停止1进入容器[root@localhost~]

CentOS7containerrunssuccessfullysectionEnterthecontainerEnterthecontainercommandexecutionsuccessfullysectionStopanddeletethecontainerStopanddeletecommandexecutionsuccessfullysectionCompleteDockerinstallationCentOS7imageCompleteDockerdockerinstallationcentos7imagedockerimages//Checkwhetherthereisalocalimage,ifnot,performapullCommandtopullcentos7image[root@localhost~]#dockerpullcentos:7

后台-插件-广告管理-内容页尾部广告(手机)

标签: 如何制作docker镜像

发表评论

评论列表

佛跳墙加速器 Copyright @ 2011-2022 All Rights Reserved. 版权所有 备案号:京ICP1234567-2号