docker中使用systemd
- systemd requires the
CAP_SYS_ADMINcapability. This means running docker with--privileged. Not good for a base image. - systemd requires access to the cgroups filesystem.
- systemd has a number of unit files that don’t matter in a container, and they cause errors if they’re not removed
Sending build context to Docker daemon 490 MB
Sending build context to Docker daemon
Step 0 : FROM centos:latest
---> b157b77b1a65
Step 1 : MAINTAINER feisky
---> Using cache
---> 4add1a12ff67
Step 2 : RUN yum -y install systemd systemd-libs
---> Using cache
---> 2bc5274f7dd2
Step 3 : RUN yum clean all; (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/*;
---> Running in d132481218d7
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
---> 7a9492819396
Removing intermediate container d132481218d7
Step 4 : VOLUME /sys/fs/cgroup
---> Running in d5a93c8ee296
---> 10b06676ea4d
Removing intermediate container d5a93c8ee296
Step 5 : CMD /usr/sbin/init
---> Running in 6ab276a1974b
---> b519e838367f
Removing intermediate container 6ab276a1974b
Successfully built b519e838367f
docker run --privileged -d -v /sys/fs/cgroup:/sys/fs/cgroup:ro -h server.http.local -p 8081:80 -t http_server
通过下面的命令可以进入docker的shell(其中3df7d8c59f1e为容器ID):
docker中使用systemd的更多相关文章
- 如何在一个Docker中同时运行多个程序进程?
我们都知道Docker容器的哲学是一个Docker容器只运行一个进程,但是有时候我们就是需要在一个Docker容器中运行多个进程 那么基本思路是在Dockerfile 的CMD 或者 ENTRYPOI ...
- Docker中的Cgroup Driver:Cgroupfs 与 Systemd
在安装kubernetes的过程中,会出现 failed to create kubelet: misconfiguration: kubelet cgroup driver: "cgrou ...
- Docker中部署Kubernetes
Kubernetes为Google开源的容器管理框架,提供了Docker容器的夸主机.集群管理.容器部署.高可用.弹性伸缩等一系列功能:Kubernetes的设计目标包括使容器集群任意时刻都处于用户期 ...
- 在 Docker 中使用 flannel - 每天5分钟玩转 Docker 容器技术(60)
上一节我们安装和配置了 flannel,本节在 Docker 中使用 flannel. 配置 Docker 连接 flannel 编辑 host1 的 Docker 配置文件 /etc/systemd ...
- 将自己的SpringBoot应用打包发布到Linux下Docker中
目录 将自己的SpringBoot应用打包发布到Linux下Docker中 1. 环境介绍 2. 开始前的准备 2.1 开启docker远程连接 2.2 新建SpringBoot项目 3. 开始构建我 ...
- 060、在docker中使用flannel(2019-03-29 周五)
参考https://www.cnblogs.com/CloudMan6/p/7441188.html 配置docker 连接flannel 编辑host1的docker配置文件/etc/sys ...
- [转]Docker中的镜像
引言 这篇文章中我们主要来探讨下Docker镜像,它是用来启动容器的构建基石,本文的所用到的Dcoker版本是17.1,API版本是1.33,Go的版本是1.9.2,OS是基于Arch Linux的M ...
- 第 8 章 容器网络 - 060 - 在 Docker 中使用 flannel
在 Docker 中使用 flannel 编辑 host1 的 Docker 配置文件 /etc/systemd/system/docker.service.d/10-machine.conf 设置 ...
- 【kubeadm初始化报错】failed to run Kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"
复现场景 环境 系统:Centos7 kubernetes:1.18.5 docker:19.03.9 复现步骤 1.通过 yum 或 rpm 安装 kubelet kubectl kubeadm,并 ...
随机推荐
- 荣品RP4412开发板摄像头驱动调用及对焦控制
1.关于更换不同摄像头驱动调用问题. 问:RP4412开发板,我用的摄像头640*480图像预览时OK的,但是我调用1280*720的初始化预览,摄像头没有图像了,是不是camera程序也需要修改? ...
- CSS动画 防止动画结束后,回归原位
animation-fill-mode防止动画结束后,回归原位 animation: arrowsfirst 1s; animation-timing-function: linear; animat ...
- 手把手教你用python抓网页数据
http://www.1point3acres.com/bbs/thread-83337-1-1.html
- php函数的可变参数
<?php function add() { $arr = func_get_args(); //func_num_args() $sum =0; for($i=0;$i<count($a ...
- 配置ConvenientBanner时出现的问题
ConvenientBanner: compile 'com.bigkoo:convenientbanner:2.0.5' 找不到依赖库 classpath 'com.jfrog.bintray.gr ...
- having()方法设置查询条件,where()设置查询条件
having 和 where区别 ① 使用有先后顺序 ② where price>100 having price>100 ③ where 设置条件,字段必须是数据表中存在的 ...
- C++ using namespace std(转载)
转载自http://www.kuqin.com/language/20080107/3532.html 感谢这位大神的解答! 以下的内容摘抄自转载的文章里面的部分内容. 早些的实现将标准库功能定义在全 ...
- system_call的处理过程
一. 跟踪time系统调用 使用gdb调试跟踪系统调用内核函数sys_time 过程如下: 对sys_time设置断点之后,在menuOS中执行time命令,发现系统停在systime处,输入S单步执 ...
- Linux分区介绍
分区的大小主要取决于个人的选择,以下内容可能会有一定帮助:/boot - 200 MB 实际需求大约 100 MB,如果有多个内核/启动镜像同时存在,建议分配 200 或者 300 MB./ - 15 ...
- poj3180 强连通
题意:给定一张 n 点 m 边的有向图,问有多少个强连通分量点数大于等于2 . 题意看懂基本就没有问题了. #include<stdio.h> #include<string.h&g ...