aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUltrabug <ultrabug@gentoo.org>2014-06-19 10:51:19 +0200
committerUltrabug <ultrabug@gentoo.org>2014-06-19 10:51:19 +0200
commitb36e1e04c996e413d2082ed90ba44a81c8e97673 (patch)
treea12a31e0a070d9de045b5875e9a74855bef1681c
parentInitial commit (diff)
downloaddocker-images-b36e1e04c996e413d2082ed90ba44a81c8e97673.tar.gz
docker-images-b36e1e04c996e413d2082ed90ba44a81c8e97673.tar.bz2
docker-images-b36e1e04c996e413d2082ed90ba44a81c8e97673.zip
initial commit
-rw-r--r--README.md8
-rw-r--r--amd64/Dockerfile33
-rw-r--r--amd64/build.sh28
3 files changed, 68 insertions, 1 deletions
diff --git a/README.md b/README.md
index 32b3d75..0ea275c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,10 @@
docker-brew-gentoo
==================
-Common effort to get an official and automated gentoo base docker container
+We're working on getting an AMD64 automated build atm, all help welcome !
+
+
+Contribue
+=========
+
+Join #gentoo-docker on FreeNode IRC and ping us with your ideas !
diff --git a/amd64/Dockerfile b/amd64/Dockerfile
new file mode 100644
index 0000000..03eeeb8
--- /dev/null
+++ b/amd64/Dockerfile
@@ -0,0 +1,33 @@
+FROM scratch
+
+MAINTAINER Gentoo_Community
+
+# This one should be present by running the build.sh script
+ADD stage3-amd64.tar.xz /
+
+# 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
+
+# Used when this image is the base of another
+#
+# Setup the portage directory and permissions
+ONBUILD RUN mkdir -p /usr/portage/{distfiles,metadata,packages}
+ONBUILD RUN chown -R portage:portage /usr/portage
+ONBUILD RUN echo "masters = gentoo" > /usr/portage/metadata/layout.conf
+# Sync portage
+ONBUILD RUN emerge-webrsync -q
+# Finalization
+ONBUILD RUN env-update
diff --git a/amd64/build.sh b/amd64/build.sh
new file mode 100644
index 0000000..d11ff05
--- /dev/null
+++ b/amd64/build.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+base_url="http://distfiles.gentoo.org/releases/amd64/autobuilds"
+
+latest_stage3=$(curl "${base_url}/latest-stage3-amd64.txt" 2>/dev/null | grep -v '#')
+stage3=$(basename "${latest_stage3}")
+
+if [ -f "${stage3}" ]; then
+ echo "Skipping download, I already have the tarball."
+ if [ -f stage3-amd64.tar.xz ]; then
+ xz=false
+ else
+ xz=true
+ fi
+else
+ wget "${base_url}/${latest_stage3}" -O "${stage3}" || exit 1
+ echo "I got the tarball alright."
+ xz=true
+fi
+
+if [ ${xz} == true ]; then
+ echo "I'm transforming the bz2 tarball to xz (golang bug). This will take some time..."
+ bunzip2 -c "${stage3}" | xz -z > stage3-amd64.tar.xz || exit 2
+fi
+echo "I'm done with the tarball."
+
+echo "Building docker Gentoo image now..."
+docker build -t gentoo . \ No newline at end of file