diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 58b9ad271..2f94e932a 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -2,11 +2,12 @@ FROM alpine:edge MAINTAINER Justin Cormack -COPY repositories /etc/apk/repositories -COPY motd hostname /etc/ +COPY repositories /etc/apk RUN apk update && apk upgrade && apk add e2fsprogs docker +COPY etc /etc/ + RUN ln -s /bin/busybox /init CMD ["/bin/sh"] diff --git a/alpine/Makefile b/alpine/Makefile index 8fcbc9949..f3cb2de49 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -1,6 +1,6 @@ all: initrd.img -initrd.img: Dockerfile hostname repositories motd +initrd.img: Dockerfile repositories etc/hostname etc/motd etc/inittab rm -f initrd.img docker build -t moby:test . docker run -i -v $(PWD):/export moby:test /export/mkinitrd.sh diff --git a/alpine/hostname b/alpine/etc/hostname similarity index 100% rename from alpine/hostname rename to alpine/etc/hostname diff --git a/alpine/etc/inittab b/alpine/etc/inittab new file mode 100644 index 000000000..e17cad7b1 --- /dev/null +++ b/alpine/etc/inittab @@ -0,0 +1,21 @@ +# /etc/inittab + +::sysinit:/sbin/rc sysinit +::wait:/sbin/rc default + +# Set up a couple of getty's +#tty1::respawn:/sbin/getty 38400 tty1 +#tty2::respawn:/sbin/getty 38400 tty2 +#tty3::respawn:/sbin/getty 38400 tty3 +#tty4::respawn:/sbin/getty 38400 tty4 +#tty5::respawn:/sbin/getty 38400 tty5 +#tty6::respawn:/sbin/getty 38400 tty6 + +# Put a getty on the serial port +ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 + +# Stuff to do for the 3-finger salute +::ctrlaltdel:/sbin/reboot + +# Stuff to do before rebooting +::shutdown:/sbin/rc shutdown diff --git a/alpine/motd b/alpine/etc/motd similarity index 100% rename from alpine/motd rename to alpine/etc/motd