Created
September 13, 2017 09:22
-
-
Save rawkode/97aa070f8631a41e10ba56209c998285 to your computer and use it in GitHub Desktop.
Docker Mutistage Build Example
This file contains 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
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"] |
This file contains 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
#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