Skip to content

Instantly share code, notes, and snippets.

@nuta
Created May 3, 2021 13:09
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 nuta/4c9ecd0d1a401dc5be88095bea5a991a to your computer and use it in GitHub Desktop.
Save nuta/4c9ecd0d1a401dc5be88095bea5a991a to your computer and use it in GitHub Desktop.
FROM ubuntu:latest
RUN apt update -y && apt install -y musl-tools
ADD hello.c /hello.c
RUN musl-gcc -static hello.c -o /hello
RUN mkdir /empty_dir
FROM scratch
WORKDIR /
COPY --from=0 /hello /hello
COPY --from=0 /empty_dir /tmp
# Add statically-linked busybox shell with musl libc.
ADD busybox /bin/sh
CMD ["/hello"]
@nwtgck
Copy link

nwtgck commented Jan 3, 2022

@nuta
Thanks you for the wonderful project!

hello.c is missing. How can I get hello.c and busybox?

@nuta
Copy link
Author

nuta commented Jan 3, 2022 via email

@nwtgck
Copy link

nwtgck commented Jan 3, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment