Skip to content

Commit

Permalink
Dockerfile Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aminvakil committed Jul 6, 2020
1 parent 3f665ae commit 15d3a8e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM alpine:3.11
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 15d3a8e

Please sign in to comment.