example rootless

This commit is contained in:
Colin 2024-04-30 22:22:32 -04:00
parent 6581cf568a
commit 7daed447ef
1 changed files with 23 additions and 0 deletions

23
Dockerfile Normal file
View File

@ -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"]