Skip to content

Instantly share code, notes, and snippets.

@tonymet
Last active May 6, 2019 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonymet/646f1125f30e826e4734780c74a3fa44 to your computer and use it in GitHub Desktop.
Save tonymet/646f1125f30e826e4734780c74a3fa44 to your computer and use it in GitHub Desktop.

100kB Docker Image

FROM alpine:latest as builder
WORKDIR /build
RUN apk update && \
apk add gcc make libc-dev
COPY . ./
RUN make
FROM scratch
WORKDIR /
COPY --from=builder /build/hello .
CMD ["/hello"]
#include <stdio.h>
int main(void){
puts("Hello World\n");
}
hello: hello.c
gcc -o $@ $< -static
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment