Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Last active June 4, 2016 15:05
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 gdamjan/67be920f31c10d3068ed669c2d9b914b to your computer and use it in GitHub Desktop.
Save gdamjan/67be920f31c10d3068ed669c2d9b914b to your computer and use it in GitHub Desktop.
build basic, minimal docker image with archlinux's glibc included. for binary apps that need glibc to run (size: 14MB)
# build basic, minimal docker image with archlinux's glibc
# get the glibc archive on the host, since busybox wget doesn't work with https
# wget http://www.archlinux.org/packages/core/x86_64/glibc/download/ -O glibc.tar
FROM busybox
MAINTAINER Damjan (gdamjan@gmail.com)
COPY glibc.tar /tmp/
COPY exclude.list /tmp/
RUN tar xf /tmp/glibc.tar usr/lib/ -X /tmp/exclude.list -C / && \
ln -s /usr/lib /lib64 && ln -s /usr/lib /lib && \
rm /tmp/glibc.tar /tmp/exclude.list
CMD ['/bin/sh']
usr/lib/*.a
usr/lib/*.o
usr/lib/audit
usr/lib/locale
usr/lib/gconv
usr/lib/getconf
usr/lib/systemd
usr/lib/tmpfiles.d
@gdamjan
Copy link
Author

gdamjan commented Jun 4, 2016

Used this for ngrok, just added:

COPY ngrok /usr/bin/ngrok
ENTRYPOINT ["/usr/bin/ngrok"]
CMD ["--help"]

on top of this (well at the bottom) and rebuilt. Size: 28MB

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