sip-tarpit/Dockerfile

30 lines
852 B
Docker
Raw Normal View History

2024-04-16 17:39:33 +02:00
################################################################################
# Builder
################################################################################
FROM clux/muslrust:stable AS builder
WORKDIR /app
COPY . .
RUN cargo build --release
RUN strip target/x86_64-unknown-linux-musl/release/sip-tarpit
################################################################################
# Final stage
################################################################################
FROM alpine:latest
# Create a group and user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
# Copy our build
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/sip-tarpit /app/sip-tarpit
# Tell docker that all future commands should run as the appuser user
USER appuser:appgroup
# Run
CMD ["/app/sip-tarpit"]