From 050ee55ffa636c53c39e92beb2ce71e3a9c5c436 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 7 Dec 2015 15:43:39 +0000 Subject: [PATCH] fix up files that Docker bind mounts in so they are not set to desired values Signed-off-by: Justin Cormack --- alpine/Makefile | 4 +++- alpine/etc/{hostname => hostname-} | 0 alpine/etc/hosts- | 6 ++++++ alpine/etc/resolv.conf- | 4 ++++ alpine/mkinitrd.sh | 7 ++++++- 5 files changed, 19 insertions(+), 2 deletions(-) rename alpine/etc/{hostname => hostname-} (100%) create mode 100644 alpine/etc/hosts- create mode 100644 alpine/etc/resolv.conf- 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