Created
November 12, 2025 07:24
-
-
Save CypherpunkSamurai/7100726d457972b1385106a0fb239180 to your computer and use it in GitHub Desktop.
distroless alpine dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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