Skip to content

Instantly share code, notes, and snippets.

@rawkode
Created September 13, 2017 09:22
Show Gist options
  • Save rawkode/97aa070f8631a41e10ba56209c998285 to your computer and use it in GitHub Desktop.
Save rawkode/97aa070f8631a41e10ba56209c998285 to your computer and use it in GitHub Desktop.
Docker Mutistage Build Example
FROM gcc AS builder
COPY main.c /code/main.c
WORKDIR /code
RUN gcc -static main.c -o main
FROM scratch
COPY --from=builder /code/main /main
ENTRYPOINT ["/main"]
#include <stdio.h>
int main() {
printf("Hello, world!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment