From bf8efa8b8e9057041d154ea319801bb1e936e8e2 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Sat, 5 Feb 2022 23:40:54 +0000 Subject: [PATCH] Add dockerfiles --- DockerfileBuildEnv | 4 ++++ DockerfileCN | 3 +++ DockerfileRunEnv | 22 ++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 DockerfileBuildEnv create mode 100644 DockerfileCN create mode 100644 DockerfileRunEnv diff --git a/DockerfileBuildEnv b/DockerfileBuildEnv new file mode 100644 index 0000000..6b0c9db --- /dev/null +++ b/DockerfileBuildEnv @@ -0,0 +1,4 @@ +FROM ubuntu:latest +RUN apt update \ + && apt install -y build-essential \ + && rm -rf /var/lib/apt/lists/* diff --git a/DockerfileCN b/DockerfileCN new file mode 100644 index 0000000..cb72d45 --- /dev/null +++ b/DockerfileCN @@ -0,0 +1,3 @@ +FROM ubuntu:latest +RUN sed -i 's/archive.ubuntu.com/mirrors.cloud.tencent.com/g; s/security.ubuntu.com/mirrors.cloud.tencent.com/g' /etc/apt/sources.list \ + && rm -f /etc/apt/apt.conf.d/docker-gzip-indexes diff --git a/DockerfileRunEnv b/DockerfileRunEnv new file mode 100644 index 0000000..503f498 --- /dev/null +++ b/DockerfileRunEnv @@ -0,0 +1,22 @@ +FROM ubuntu:latest +RUN rm -f /etc/apt/apt.conf.d/docker-gzip-indexes \ + && apt update \ + && TZ=Asia/Shanghai DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt install -y systemd systemd-sysv \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* /var/tmp/* \ + && sed 's/ProtectHostname=yes/ProtectHostname=no/g' -i /lib/systemd/system/systemd-logind.service \ + && cd /lib/systemd/system/sysinit.target.wants/ \ + && ls | grep -v systemd-tmpfiles-setup | xargs rm -f $1 \ + && rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/basic.target.wants/* \ + /lib/systemd/system/anaconda.target.wants/* \ + /lib/systemd/system/plymouth* \ + /lib/systemd/system/systemd-update-utmp* +RUN apt update \ + && apt install -y python3 nginx iputils-ping iproute2 curl \ + && rm -rf /var/lib/apt/lists/* +ENTRYPOINT ["/bin/systemd"]