This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
executable file
·55 lines (44 loc) · 1.94 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
53
54
55
#
# SFTP only Container - thomasw64/sshd
#
# Under Apache 2.0 License see LICENSE file.
#
# Copyright IBM 2021,2022
# SPDX-License-Identifier: Apache2.0
#
# Authors:
# - Thomas Weinzettl <thomasw@ae.ibm.com>
#
#===============================================================================
# Choose from one of the two:
# ubi8-minimal:latest ..... if you have RH licenses
# fedora-minimal:latest ... if you prefer complete open source
# FROM registry.access.redhat.com/ubi8-minimal:latest
FROM registry.fedoraproject.org/fedora-minimal:latest
LABEL org.opencontainers.image.title="SFTP only Container"
LABEL org.opencontainers.image.description="A container that allows to share docker/podman volumes via a secure SFTP only connection."
LABEL org.opencontainers.image.authors="thomasw@ae.ibm.com"
LABEL org.opencontainers.image.source="https://github.com/IBM/sftp-only-container.git"
LABEL org.opencontainers.image.vendor="IBM"
LABEL org.opencontainers.image.licenses="Apache-2.0"
#LABEL description="A ssh container with an simple method to import public keys"
LABEL org.opencontainers.image.version="0.3.1"
RUN microdnf --nodocs -y install openssh-server sudo && \
microdnf clean all
RUN mkdir -p /home/.sshd/ && \
chmod 700 /home/.sshd
RUN sed -i "s/#PubkeyAuthentication yes/PubkeyAuthentication yes/g" /etc/ssh/sshd_config && \
sed -i "s/PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config && \
sed -i "s/PasswordAuthentication yes/PasswordAuthentication no/g" /etc/ssh/sshd_config && \
sed -i "s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g" /etc/ssh/sshd_config && \
sed -i "s/#PermitEmptyPasswords no/PermitEmptyPasswords no/g" /etc/ssh/sshd_config
COPY entrypoint.sh /entrypoint.sh
COPY ssh-key.sh /bin/ssh-key.sh
COPY ssh-functions.sh /bin/ssh-functions.sh
COPY containeradm /bin/containeradm
ENV SFTP_ONLY=no
ENV DEBUG=0
VOLUME ["/Volume","/home/"]
EXPOSE 22
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/sbin/sshd","-D","-e"]