From 7daed447efd9ad5e9a7708975924581061908211 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 30 Apr 2024 22:22:32 -0400 Subject: [PATCH] example rootless --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..16885e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use an intermediate image for setting up the environment and permissions +FROM alpine:latest as builder + +# Add the binary directly from the URL +ADD https://git.nixc.us/colin/ssh-timeout/src/branch/main/dist/ssh-timeout_linux_amd64_static /ssh-timeout + +# Set execute permissions on the binary +RUN chmod +x /ssh-timeout + +# Start from a scratch image for the final output +FROM scratch + +# Copy the prepared binary from the builder stage +COPY --from=builder /ssh-timeout /ssh-timeout + +# Optionally define default environment variables +ENV SSH_BACKEND="default-backend:22" +ENV SSH_MAX_DURATION="3600" +ENV LISTEN_ADDR=":2222" + +# Command to run the binary +CMD ["/ssh-timeout"] +