Skip to content

Commit

Permalink
Dockerfile Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aminvakil committed Dec 17, 2020
1 parent a3ad270 commit 574b994
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM alpine:3.12

RUN apk update && \
apk add bash git openssh rsync augeas shadow rssh && \
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/ && \
RUN apk add --no-cache bash

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apk add --no-cache "git" "openssh" "rsync" "augeas" "shadow" "rssh" && \
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/*
echo -e "Port 22\n" >> '/etc/ssh/sshd_config' && \
cp -a '/etc/ssh' '/etc/ssh.cache'

EXPOSE 22

Expand Down

0 comments on commit 574b994

Please sign in to comment.