systemd&&docker镜像支持systemd
k8s环境中,经常需要一个容器进行一些调试,特意打包了常用小工具
FROM centos:7
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo && \
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo && \
curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo && \
yum makecache && \
yum install -y which wget openvpn telnet && \
yum clean all && \
curl -o /usr/bin/systemctl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py && \
chmod +x /usr/bin/systemctl && \
true
WORKDIR /root
隐藏秘籍,内置了openvpn-client
version: "3"
services:
busybox:
image: harbor.iovm.com/public/busybox:latest
container_name: busybox
network_mode: host # 注意一定要是host模式,因为他默认监听在容器内,并不能与主机直接通讯
privileged: true
restart: always
volumes:
- ./ovpn_configuration_file.ovpn:/data/vpclub/openvpn/ovpn_configuration_file.ovpn
command: "/usr/sbin/openvpn --config /data/vpclub/openvpn/ovpn_configuration_file.ovpn"