Last active
February 19, 2024 18:33
-
-
Save obriencj/892adabc5c252a953b2fddb699f4b5c4 to your computer and use it in GitHub Desktop.
tiny static native container
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
# This is a simple example representing a statically linked executable | |
# embedded in the smallest possible container | |
FROM gcc:latest as BUILD | |
WORKDIR /build | |
RUN gcc -x c -static -o hello - <<EOF | |
#include <stdio.h> | |
int main(void) { printf("Hello world\\n"); return 0; } | |
EOF | |
FROM scratch | |
COPY --from=BUILD /build/hello / | |
ENTRYPOINT ["/hello"] | |
# The end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment