aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteev Klimaszewski <steev@gentoo.org>2015-08-04 10:54:46 -0700
committerSteev Klimaszewski <steev@gentoo.org>2015-08-04 10:54:46 -0700
commita6c18523c0f1800cf544d28c32d52c85467c6950 (patch)
treebec6b8ec4eb9384aa65e0b8294075ca709fac495
parentMerge pull request #15 from mrueg/master (diff)
downloaddocker-images-a6c18523c0f1800cf544d28c32d52c85467c6950.tar.gz
docker-images-a6c18523c0f1800cf544d28c32d52c85467c6950.tar.bz2
docker-images-a6c18523c0f1800cf544d28c32d52c85467c6950.zip
Add amd64-nomultilib build
Signed-off-by: Steev Klimaszewski <steev@gentoo.org>
-rw-r--r--amd64-nomultilib/Dockerfile24
-rwxr-xr-xamd64-nomultilib/build.sh29
2 files changed, 53 insertions, 0 deletions
diff --git a/amd64-nomultilib/Dockerfile b/amd64-nomultilib/Dockerfile
new file mode 100644
index 0000000..3fb7d92
--- /dev/null
+++ b/amd64-nomultilib/Dockerfile
@@ -0,0 +1,24 @@
+FROM busybox
+
+MAINTAINER Gentoo Docker Team
+
+# This one should be present by running the build.sh script
+ADD build.sh /
+
+RUN /build.sh amd64 x86_64 -nomultilib
+
+# Setup the (virtually) current runlevel
+RUN echo "default" > /run/openrc/softlevel
+
+# Setup the rc_sys
+RUN sed -e 's/#rc_sys=""/rc_sys="lxc"/g' -i /etc/rc.conf
+
+# Setup the net.lo runlevel
+RUN ln -s /etc/init.d/net.lo /run/openrc/started/net.lo
+
+# Setup the net.eth0 runlevel
+RUN ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
+RUN ln -s /etc/init.d/net.eth0 /run/openrc/started/net.eth0
+
+# By default, UTC system
+RUN echo 'UTC' > /etc/timezone
diff --git a/amd64-nomultilib/build.sh b/amd64-nomultilib/build.sh
new file mode 100755
index 0000000..ade04b8
--- /dev/null
+++ b/amd64-nomultilib/build.sh
@@ -0,0 +1,29 @@
+suffix=$3 # e.g. -nomultilib
+arch=$1
+busybox_version=$2
+dist="http://distfiles.gentoo.org/releases/${arch}/autobuilds/"
+stage3="$(wget -q -O- ${dist}/latest-stage3-${arch}${suffix}.txt | tail -n 1 | cut -f 1 -d ' ')"
+
+mkdir newWorldOrder; cd newWorldOrder
+echo "Downloading and extracting ${stage3}..."
+wget -q -c "${dist}/${stage3}"
+bunzip2 -c $(basename ${stage3}) | tar --exclude "./etc/hosts" --exclude "./sys/*" -xf -
+rm -f $(basename ${stage3})
+wget -q -O /busybox "http://www.busybox.net/downloads/binaries/latest/busybox-${busybox_version}"
+chmod +x /busybox
+/busybox rm -rf /lib* /usr /var /bin /sbin /opt /mnt /media /root /home /run /tmp
+/busybox cp -fRap lib* /
+/busybox cp -fRap bin boot home media mnt opt root run sbin tmp usr var /
+/busybox cp -fRap etc/* /etc/
+cd /
+#commit suicide
+/busybox rm -rf newWorldOrder /busybox /build.sh /linuxrc
+
+latest_stage3=$(curl "${base_url}/latest-stage3-amd64-nomultilib.txt" 2>/dev/null | grep -v '#' | awk '{print $1}')
+stage3=$(basename "${latest_stage3}")
+
+# Self destruct
+rm -f /Dockerfile /build.sh
+
+echo "Bootstrapped ${stage3} into /:"
+ls --color -lah