-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (42 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM --platform=linux/amd64 ubuntu:latest
# Set the environment variable to avoid debconf warning
ENV DEBIAN_FRONTEND=noninteractive
# Update the package index and install necessary packages
RUN apt-get update && apt-get install -y \
curl \
git \
nano \
nginx \
openssh-server \
openssl \
python3 \
python3-pip \
sudo \
vim \
wget \
gnupg
# Install SCP
RUN apt-get install -y openssh-client
# Install systemd
RUN apt-get install -y systemd && \
rm -rf /var/cache/apt/* && \
mkdir -p /run/systemd && \
echo "export TZ='Asia/Shanghai'" >> /etc/profile
# Set the environment variable to enable systemd
ENV container docker
# Enable systemd
RUN (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" ]
# Set the default user to root
USER root
# Set the working directory to the root user's home directory
WORKDIR /root
# Start systemd on boot
CMD ["/sbin/init"]