diff options
author | Chaos <haos.engine@gmail.com> | 2015-10-28 22:56:54 +0100 |
---|---|---|
committer | Chaos <haos.engine@gmail.com> | 2015-10-28 22:56:54 +0100 |
commit | 4c9cac761a5d6e50b93d5dff970566c1dba68586 (patch) | |
tree | fba0df48ef23c6f4947fb0265152f38de1fb55d2 | |
parent | added sha512 stage3 verification (diff) | |
parent | Merge pull request #23 from steev/master (diff) | |
download | docker-images-4c9cac761a5d6e50b93d5dff970566c1dba68586.tar.gz docker-images-4c9cac761a5d6e50b93d5dff970566c1dba68586.tar.bz2 docker-images-4c9cac761a5d6e50b93d5dff970566c1dba68586.zip |
Merge branch 'master' of https://github.com/gentoo/gentoo-docker-images
pulling recent changes from other pull requests
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | amd64-hardened-nomultilib/Dockerfile | 24 | ||||
-rwxr-xr-x | amd64-hardened-nomultilib/build.sh | 29 | ||||
-rwxr-xr-x | amd64-hardened/build.sh | 1 | ||||
-rw-r--r-- | amd64-nomultilib/Dockerfile | 24 | ||||
-rwxr-xr-x | amd64-nomultilib/build.sh | 29 | ||||
-rw-r--r-- | docs/README.md | 2 | ||||
-rw-r--r-- | portage/Dockerfile | 10 |
8 files changed, 132 insertions, 9 deletions
@@ -1,17 +1,31 @@ # Gentoo Docker Images -A repository of Dockerfiles and utilities for generating Gentoo docker images. +A collection of Dockerfiles for generating Gentoo docker images. -Currently we are working on adding amd64 images and will expand into other -arches over time. +These images are intended to be created automatically by +[docker hub](https://hub.docker.com/u/gentoo/) and include basic +stage3 images and an image usable as a `/usr/portage` volume. + +# DockerHub + +https://registry.hub.docker.com/u/gentoo/stage3-amd64/ ## Inventory * portage +* stage3 + * stage3-amd64 + * stage3-adm64-hardened + * stage3-amd64-nomultilib # Contributing -Join us at irc://freenode.net/#gentoo-containers. We'd love to hear any ideas. +We'd love to hear any ideas. Feel free to contact us via any of the following +methods: + +* IRC: irc://freenode.net/#gentoo-containers +* EMAIL: gentoo-containers@lists.gentoo.org +* GITHUB: https://github.com/gentoo/gentoo-docker-images ## Policy diff --git a/amd64-hardened-nomultilib/Dockerfile b/amd64-hardened-nomultilib/Dockerfile new file mode 100644 index 0000000..30f9785 --- /dev/null +++ b/amd64-hardened-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 -hardened+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-hardened-nomultilib/build.sh b/amd64-hardened-nomultilib/build.sh new file mode 100755 index 0000000..96f6ad8 --- /dev/null +++ b/amd64-hardened-nomultilib/build.sh @@ -0,0 +1,29 @@ +suffix=$3 # e.g. -hardened +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-hardened+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 diff --git a/amd64-hardened/build.sh b/amd64-hardened/build.sh index 83bbbed..644f62d 100755 --- a/amd64-hardened/build.sh +++ b/amd64-hardened/build.sh @@ -21,6 +21,7 @@ stage3="$(basename ${stage3path})" # Create working directory, keep a copy of busybox handy mkdir newWorldOrder; cd newWorldOrder +<<<<<<< HEAD cp /bin/busybox . echo "Downloading and extracting ${stage3path}..." 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 diff --git a/docs/README.md b/docs/README.md index cb55ae2..65d71b5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -58,7 +58,7 @@ Support for older versions (down to 1.0) is provided on a best-effort basis. If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/gentoo/gentoo-docker-images/issues). -You can also reach many of the official image maintainers via the `#gentoo-contain` IRC channel on [Freenode](https://freenode.net). +You can also reach many of the official image maintainers via the `#gentoo-containers` IRC channel on [Freenode](https://freenode.net). ## Contributing diff --git a/portage/Dockerfile b/portage/Dockerfile index e78c52f..85d7f3b 100644 --- a/portage/Dockerfile +++ b/portage/Dockerfile @@ -2,7 +2,9 @@ FROM busybox:latest MAINTAINER Gentoo Container Team <containers@gentoo.org> ADD http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2 / -RUN mkdir -p /usr && bzcat /portage-latest.tar.bz2 | tar -xf - -C /usr \ - && mkdir -p /usr/portage/{distfiles,metadata,packages} \ - && echo "masters = gentoo" > /usr/portage/metadata/layout.conf \ - && rm -f /portage-latest.tar.bz2 + +RUN mkdir -p /usr +RUN bzcat /portage-latest.tar.bz2 | tar -xf - -C /usr +RUN mkdir -p /usr/portage/distfiles /usr/portage/metadata /usr/portage/packages + +VOLUME /usr/portage |