-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (33 loc) · 1.39 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
FROM alpine:3.10
WORKDIR /
COPY . /
RUN sed -i s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g /etc/apk/repositories \
# Install SSHD deps
&& apk update \
&& apk add bash git openssh rsync augeas shadow rssh python3 python3-dev py3-pip sshpass vim \
# Install Python deps
&& apk add --no-cache --virtual .build-deps \
gcc \
make \
linux-headers \
bash \
alpine-sdk \
libffi-dev \
openssl-dev \
&& pip3 install -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt \
&& apk del .build-deps \
#&& pip3 install -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com ansible \
#&& ln -sf /ansible /etc/ansible \
&& deluser $(getent passwd 33 | cut -d: -f1) \
&& delgroup $(getent group 33 | cut -d: -f1) 2>/dev/null || true \
&& mkdir -p ~root/.ssh /etc/authorized_keys && chmod 700 ~root/.ssh/ \
&& augtool 'set /files/etc/ssh/sshd_config/AuthorizedKeysFile ".ssh/authorized_keys /etc/authorized_keys/%u"' \
&& echo -e "Port 22\n" >> /etc/ssh/sshd_config \
&& cp -a /etc/ssh /etc/ssh.cache \
&& rm -rf /var/cache/apk/*
EXPOSE 22 8000 8443
#ENTRYPOINT ["python", "main.py", "--address=0.0.0.0"]
COPY entry.sh /entry.sh
#CMD ["/entry.sh"]
ENTRYPOINT ["/entry.sh"]
#CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config"]