Docker下使用centos无法使用systemctl怎么办

提交正在使用的容器: docker commit [ContainerId]
提交停止正在运行无法使用Systemctl的容器: docker stop [ContainerId]
删除这个容器(可选): docker rm [ContainerId]

通过刚刚提交的镜像重启容器, 注意启动命令

docker run -itd --name dev-centos --privileged=true dev/centos:latest /usr/sbin/init

注意: 一定要加上 --privileged=true

exec进入交互终端: docker exec -it dev-centos /bin/bash

使用systecmctl

猜你喜欢

转载自www.cnblogs.com/Laggage/p/13403391.html