docker centos systemctl开启
来源:互联网 发布:windows桌面更新黑屏 编辑:程序博客网 时间:2024/06/06 04:52
这是阿里云的centos说明,里面有systemd的说明,阿里云docker centos
整体流程,是使用下面的Dockerfile,下载镜像,然后开始新建容器
1.下载centos
Dockerfile for systemd base image
FROM centos:7ENV container dockerRUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \systemd-tmpfiles-setup.service ] || rm -f $i; done); \rm -f /lib/systemd/system/multi-user.target.wants/*;\rm -f /etc/systemd/system/*.wants/*;\rm -f /lib/systemd/system/local-fs.target.wants/*; \rm -f /lib/systemd/system/sockets.target.wants/*udev*; \rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \rm -f /lib/systemd/system/basic.target.wants/*;\rm -f /lib/systemd/system/anaconda.target.wants/*;VOLUME [ "/sys/fs/cgroup" ]CMD ["/usr/sbin/init"]
This Dockerfile deletes a number of unit files which might cause issues. From here, you are ready to build your base image.
$ docker build --rm -t ghoiufyia/centos7 .
这样会生成一个镜像,该镜像就可以使用systemctl2.生成一个容器 docker run --privileged --name "master" -tid -p 8000:80 -p 8001:3306 -p 8002:6379 -p 8003:8080 -p 8004:8888 ghoiufyia/centos7
加-tid,d是因为后台运行,否则一致阻塞运行
3.docker exec -it "开启的容器的id" /bin/bash
4.添加本地镜像:docker commit -m "lamp+nginx+redis" -a="ghoiufyia" "开启的容器的id" ghoiufyia/centos7:v0.1
5.开启容器 docker start "容器id"
6.关闭容器 docker stop "容器id"
7.使用自己提交新生成镜像,使用2、3步即可
8.登陆 docker login
9.将容器上传 docker push 本地镜像名称
docker ps -al 查看容器
docker image -al 查看镜像
刚开始ifconfig提示没这个命令,yum upgrade yum install -y net-tools
- docker centos systemctl开启
- Docker使用开启systemctl功能的cenos7镜像
- centos 使用 systemctl 使 docker 容器(container)开机启动
- systemctl开启启动redis
- docker centos 使用 systemctl Failed to get D-Bus connection: Operation not permitted
- CentOS 7.0 systemctl使用说明
- Centos 7 之 systemctl
- centos systemctl用法
- centos 7 systemctl 命令总结
- CentOS 7 上systemctl 的用法
- RHEL/CentOS 7.x的systemctl
- CentOS 7 上systemctl 的用法
- CentOS 7 上systemctl 的用法
- CentOS 7 上systemctl 的用法
- CentOS 7.0 服务管理 – systemctl 命令
- CentOS 7 上systemctl 的用法
- centos 7 解决 systemctl dbus bug
- CentOS 7 上systemctl 的用法 【转】
- hadoop distcp命令的使用
- 计算机网络 -- 物理层
- [机器学习]划分训练集和测试集的方法
- 解决方案---git add .时 警告warning: LF will be replaced by CRLF
- go语言学习资料地址
- docker centos systemctl开启
- Rest风格设计
- 程序学徒与导师
- Java内存模型和JVM优化总结
- 浅入rails。真的很浅
- 网站入侵工具 SQL注入神器
- Caffe
- Python实践二
- Regular Expression Matching