Permalink
Browse files

Add -static-runtime image

  • Loading branch information...
Matt Campbell
Matt Campbell committed Mar 30, 2014
1 parent 227e516 commit dafb65ebea0a115b0a09903b8e57bfab67011971
Showing with 21 additions and 1 deletion.
  1. +5 −0 Dockerfile
  2. +1 −0 README.md
  3. +4 −0 bootstrap.sh
  4. +4 −0 rootfs/static-runtime/Dockerfile
  5. +6 −0 steps/final/04-busybox
  6. +1 −1 steps/temporary/11-directories
View
@@ -4,10 +4,13 @@ RUN mkdir $ROOT
ADD . $ROOT/src
ENV RUNTIME_ROOT $ROOT/runtime
RUN mkdir $RUNTIME_ROOT
env STATIC_RUNTIME_ROOT $ROOT/static-runtime
RUN mkdir $STATIC_RUNTIME_ROOT
RUN $ROOT/src/build-prerequisites.sh && \
$ROOT/src/build-temporary.sh
ADD dev.tar $ROOT/dev/
ADD dev.tar $RUNTIME_ROOT/dev
ADD dev.tar $STATIC_RUNTIME_ROOT/dev
RUN chroot $ROOT /src/build-final.sh && \
rm -rf $ROOT/src && \
rm -rf $ROOT/tools && \
@@ -16,4 +19,6 @@ RUN chroot $ROOT /src/build-final.sh && \
((find $ROOT -type f -print | grep -v '\.a$' | grep -v '\.o$' | xargs strip --strip-all) || true) && \
tar cvpf /runtime-rootfs.tar -C $RUNTIME_ROOT . && \
rm -rf $RUNTIME_ROOT && \
tar cvpf /static-runtime-rootfs.tar -C $STATIC_RUNTIME_ROOT . && \
rm -rf $STATIC_RUNTIME_ROOT && \
tar cvpf /rootfs.tar -C $ROOT .
View
@@ -14,3 +14,4 @@ This process produces the following images:
* username/muslbase: full self-hosting system (musl, BusyBox, and toolchain)
* username/muslbase-runtime: runtime-only system (no toolchain)
* username/muslbase-static-runtime: runtime-only system for statically linked programs (no toolchain or shared libraries)
View
@@ -19,13 +19,17 @@ do
fi
docker rmi $username/muslbase || true
docker rmi $username/muslbase-runtime || true
docker rmi $username/muslbase-static-runtime || true
docker build --rm -t=$username/muslbase-build .
docker run --rm $username/muslbase-build cat /rootfs.tar > rootfs/full/rootfs.tar
docker build --rm -t=$username/muslbase rootfs/full
rm rootfs/full/rootfs.tar
docker run --rm $username/muslbase-build cat /runtime-rootfs.tar > rootfs/runtime/rootfs.tar
docker build --rm -t=$username/muslbase-runtime rootfs/runtime
rm rootfs/runtime/rootfs.tar
docker run --rm $username/muslbase-build cat /static-runtime-rootfs.tar > rootfs/static-runtime/rootfs.tar
docker build --rm -t=$username/muslbase-static-runtime rootfs/static-runtime
rm rootfs/static-runtime/rootfs.tar
docker rmi mwcampbell/muslbase-build-base
docker rmi $username/muslbase-build
done
@@ -0,0 +1,4 @@
FROM scratch
MAINTAINER Matt Campbell <mattcampbell@pobox.com>
ADD rootfs.tar /
ENV PATH /local/sbin:/local/bin:/sbin:/bin
View
@@ -29,3 +29,9 @@ for p in $(./busybox --list)
do
ln -sf busybox /runtime/bin/$p
done
cp -a busybox /static-runtime/bin
for p in $(./busybox --list)
do
ln -sf busybox /static-runtime/bin/$p
done
@@ -5,7 +5,7 @@
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.
for root in $ROOT $RUNTIME_ROOT
for root in $ROOT $RUNTIME_ROOT $STATIC_RUNTIME_ROOT
do
cd $root
mkdir bin

0 comments on commit dafb65e

Please sign in to comment.