diff options
author | Chaos <haos.engine@gmail.com> | 2015-03-22 12:30:58 +0100 |
---|---|---|
committer | Chaos <haos.engine@gmail.com> | 2015-03-22 12:30:58 +0100 |
commit | 99c56fa83ded361fa22d569ea2413c3a60bcd2f2 (patch) | |
tree | 1fdc59501bd274ff774eb534d20d15804fd73afb | |
parent | Update README.md (diff) | |
download | docker-images-99c56fa83ded361fa22d569ea2413c3a60bcd2f2.tar.gz docker-images-99c56fa83ded361fa22d569ea2413c3a60bcd2f2.tar.bz2 docker-images-99c56fa83ded361fa22d569ea2413c3a60bcd2f2.zip |
added x86 build catalog. Testing required (in VM probably)
-rw-r--r-- | x86/.dockerignore | 7 | ||||
-rw-r--r-- | x86/Dockerfile | 8 | ||||
-rwxr-xr-x | x86/container-build.sh | 42 |
3 files changed, 57 insertions, 0 deletions
diff --git a/x86/.dockerignore b/x86/.dockerignore new file mode 100644 index 0000000..2302238 --- /dev/null +++ b/x86/.dockerignore @@ -0,0 +1,7 @@ +*.bz2 +*.xz +*.asc +*.DIGESTS +*.CONTENTS +*.swp +busybox* diff --git a/x86/Dockerfile b/x86/Dockerfile new file mode 100644 index 0000000..c711f47 --- /dev/null +++ b/x86/Dockerfile @@ -0,0 +1,8 @@ +FROM busybox + +MAINTAINER Gentoo Docker Team + +# This one should be present by running the container-build.sh script +ADD container-build.sh / + +RUN /container-build.sh x86 i686 diff --git a/x86/container-build.sh b/x86/container-build.sh new file mode 100755 index 0000000..1999227 --- /dev/null +++ b/x86/container-build.sh @@ -0,0 +1,42 @@ +suffix=$3 # e.g. -hardened +arch=$1 +busybox_version=$2 +dist="http://distfiles.gentoo.org/releases/${arch}/autobuilds/" +stage3="$(wget -O- ${dist}/latest-stage3-${busybox_version}${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 -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 /container-build.sh /linuxrc + + + + +# Setup the rc_sys +sed -e 's/#rc_sys=""/rc_sys="lxc"/g' -i /etc/rc.conf + +# Setup the net.lo runlevel +ln -s /etc/init.d/net.lo /run/openrc/started/net.lo + +# Setup the net.eth0 runlevel +ln -s /etc/init.d/net.lo /etc/init.d/net.eth0 +ln -s /etc/init.d/net.eth0 /run/openrc/started/net.eth0 + +# By default, UTC system +echo 'UTC' > /etc/timezone + +# Self destruct +rm -f /Dockerfile /build.sh /container-build.sh + +echo "Bootstrapped ${stage3} into /:" +ls --color -lah |