From efacc7e3d49f4e5075868e75f81c97bc9c90aba9 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 5 Jun 2021 13:17:31 -0500 Subject: [PATCH] Initial build image --- Dockerfile | 28 ++++++++++++++++++++++++++++ rootfs/entrypoint.sh | 7 +++++++ 2 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100755 rootfs/entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..41eba28 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +ARG ALPINE_VERSION=3.13 + +FROM alpine:$ALPINE_VERSION AS builder +ARG RUST_VERSION=stable +ARG PIJUL_VERSION="~1.0.0-alpha" + +RUN apk add --no-cache rustup \ + && rustup-init -yqt "$RUST_VERSION" +RUN apk add --no-cache \ + build-base \ + clang \ + libsodium-dev \ + make \ + openssl-dev \ + xxhash-dev \ + zstd-dev +RUN /root/.cargo/bin/cargo install pijul --version "$PIJUL_VERSION" + +FROM alpine:$ALPINE_VERSION AS base +LABEL maintainer "Drew Short - https://git.nulloctet.com/warricksothr" +ENTRYPOINT ["/entrypoint.sh"] +EXPOSE 22 +COPY --from=builder /root/.cargo/bin/pijul /usr/local/bin/ +COPY rootfs / + +RUN apk add --no-cache openssh \ + && sed -i s/#PermitRootLogin.*/PermitRootLogin\ no/ /etc/ssh/sshd_config \ + && echo "root:root" | chpasswd diff --git a/rootfs/entrypoint.sh b/rootfs/entrypoint.sh new file mode 100755 index 0000000..99328f5 --- /dev/null +++ b/rootfs/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/ash + +# generate host keys if not present +ssh-keygen -A + +# do not detach (-D), log to stderr (-e), passthrough other arguments +exec /usr/sbin/sshd -D -e "$@"