fix up files that Docker bind mounts in so they are not set to desired values

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
Justin Cormack 2015-12-07 15:43:39 +00:00
parent 8dd1a88dec
commit 050ee55ffa
5 changed files with 19 additions and 2 deletions

View File

@ -1,6 +1,8 @@
all: initrd.img 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 rm -f initrd.img
docker build -t moby:test . docker build -t moby:test .
docker run -i -v $(PWD):/export moby:test /export/mkinitrd.sh docker run -i -v $(PWD):/export moby:test /export/mkinitrd.sh

6
alpine/etc/hosts- Normal file
View File

@ -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

4
alpine/etc/resolv.conf- Normal file
View File

@ -0,0 +1,4 @@
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844

View File

@ -42,6 +42,11 @@ mknod -m 600 sdb6 b 8 22
mkdir pty 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 find . | cpio -H newc -o > /export/initrd.img