docker restart /etc/rc.local不执行

docker restart /etc/rc.local不执行

摘要

优化的docker基础镜像ubuntu

优化的docker基础镜像ubuntu

phusion/baseimage-docker

就对于我来说,解决了,重启命令可以 /etc/rc.local

参考文档

https://github.com/phusion/baseimage-docker/blob/master/README_ZH_cn_.md

https://superuser.com/questions/1054678/can-we-execute-a-script-as-root-during-docker-container-startup

如何使用

###运行phusion/baseimage
docker run  -t -i -d  phusion/baseimage /sbin/my_init

###一行命令安装docker-bash
curl --fail -L -O https://github.com/phusion/baseimage-docker/archive/master.tar.gz && \
tar xzf master.tar.gz && \
sudo ./baseimage-docker-master/install-tools.sh

###进入docker容器
sudo docker-bash YOUR-CONTAINER-ID