dockerhub 下载的centos7镜像添加systemctl命令,jenkins启动等
dockerhub下载centos:centos7执行下面的启动可以正常执行systemctl等指令:
docker run --privileged=true -d centos:centos7 /usr/sbin/init 启动centos7
docker exec -it ffefdf6b9 /bin/bash 进入交互模式
启动jenkins 容器指令,注意端口映射:
docker run --privileged=true -p 8080:8080 -d xiaoxiao075/centos7:5.0 /usr/sbin/init
启动jenkins服务:
systemctl enable jenkins
systemctl start jenkins
比较全的指令:
docker run --privileged=true --name xiaoxiao-jenkins -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50002:50000 --restart always xiaoxiao075/centos7:6.0 /usr/sbin/init