Skip to content

Instantly share code, notes, and snippets.

@CypherpunkSamurai
Created November 12, 2025 07:24
Show Gist options
  • Select an option

  • Save CypherpunkSamurai/7100726d457972b1385106a0fb239180 to your computer and use it in GitHub Desktop.

Select an option

Save CypherpunkSamurai/7100726d457972b1385106a0fb239180 to your computer and use it in GitHub Desktop.
distroless alpine dockerfile
# Stage 1: Builder stage
FROM alpine:latest AS builder
RUN apk --no-cache add build-base git # Installs build-base and git
# Stage 2: Production stage
FROM alpine:latest AS production
# Copy specific files from the builder stage
COPY --from=builder /usr/bin/git /usr/bin/git
COPY --from=builder /usr/lib/libgit2.so.1.0 /usr/lib/libgit2.so.1.0 # Example for a library
# Or, if you need a whole directory:
# COPY --from=builder /path/to/directory /path/in/production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment