diff --git a/alpine/Makefile b/alpine/Makefile index 2e438f813..7afe17ed2 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -1,6 +1,8 @@ all: initrd.img -initrd.img: Dockerfile mkinitrd.sh repositories etc/hostname etc/motd etc/inittab +ETCFILES=etc/motd etc/inittab etc/hostname- etc/resolv.conf- etc/hosts- + +initrd.img: Dockerfile mkinitrd.sh repositories $(ETCFILES) rm -f initrd.img docker build -t moby:test . docker run -i -v $(PWD):/export moby:test /export/mkinitrd.sh diff --git a/alpine/etc/hostname b/alpine/etc/hostname- similarity index 100% rename from alpine/etc/hostname rename to alpine/etc/hostname- diff --git a/alpine/etc/hosts- b/alpine/etc/hosts- new file mode 100644 index 000000000..9d139c5b8 --- /dev/null +++ b/alpine/etc/hosts- @@ -0,0 +1,6 @@ +127.0.0.1 localhost +::1 localhost ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/alpine/etc/resolv.conf- b/alpine/etc/resolv.conf- new file mode 100644 index 000000000..fbdb06b89 --- /dev/null +++ b/alpine/etc/resolv.conf- @@ -0,0 +1,4 @@ +nameserver 8.8.8.8 +nameserver 8.8.4.4 +nameserver 2001:4860:4860::8888 +nameserver 2001:4860:4860::8844 diff --git a/alpine/mkinitrd.sh b/alpine/mkinitrd.sh index 4f1509cf2..29a130c0c 100755 --- a/alpine/mkinitrd.sh +++ b/alpine/mkinitrd.sh @@ -42,6 +42,11 @@ mknod -m 600 sdb6 b 8 22 mkdir pty -cd /tmp +# these three files are bind mounted in by docker so they are not what we want +cd /tmp/etc +mv hosts- hosts +mv resolv.conf- resolv.conf +mv hostname- hostname +cd /tmp find . | cpio -H newc -o > /export/initrd.img