first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
40
base/openssh/7.7/Dockerfile
Normal file
40
base/openssh/7.7/Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
FROM debian:stretch
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& savedAptMark="$(apt-mark showmanual)" \
|
||||
&& apt-get install -y wget \
|
||||
&& apt-get install -y --no-install-recommends build-essential zlib1g-dev libssl1.0-dev \
|
||||
&& cd /usr/src \
|
||||
&& wget -qO- https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz | tar zx --strip-components 1 \
|
||||
&& echo "sshd:x:74:74:Privilege-separated SSH:/usr/local/sbin/sshd:/sbin/nologin" >> /etc/passwd \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install \
|
||||
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||
&& apt-mark auto '.*' > /dev/null \
|
||||
&& apt-mark manual $savedAptMark \
|
||||
&& ldd /usr/local/bin/* /usr/local/sbin/* \
|
||||
| awk '/=>/ { print $3 }' \
|
||||
| sort -u \
|
||||
| xargs -r dpkg-query -S \
|
||||
| cut -d: -f1 \
|
||||
| sort -u \
|
||||
| xargs -rt apt-mark manual \
|
||||
\
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||
&& rm -rf /var/lib/apt/lists/* /usr/src/*
|
||||
|
||||
COPY --chown=root:root docker-entrypoint.sh /docker-entrypoint.sh
|
||||
|
||||
RUN set -ex \
|
||||
&& echo "PermitRootLogin yes" >> /usr/local/etc/sshd_config \
|
||||
&& chmod +x /docker-entrypoint.sh
|
||||
|
||||
EXPOSE 22
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
CMD ["/usr/local/sbin/sshd", "-D"]
|
9
base/openssh/7.7/docker-entrypoint.sh
Normal file
9
base/openssh/7.7/docker-entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ ! -z $ROOT_PASSWORD ]; then
|
||||
echo "root:$ROOT_PASSWORD" | chpasswd
|
||||
fi
|
||||
|
||||
exec "$@"
|
Reference in New Issue
Block a user