Clean up dhcpcd container

It is not necessary to bring up `eth0`, the program does it fine.

This means we can remove shell script, clean up build.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2017-04-06 15:32:22 +01:00
parent 3223897232
commit 0a030dc219
13 changed files with 14 additions and 30 deletions

View File

@ -34,7 +34,7 @@ daemon:
oomScoreAdj: -800 oomScoreAdj: -800
readonly: true readonly: true
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp:/etc - /tmp:/etc

View File

@ -21,7 +21,7 @@ daemon:
- CAP_SYS_ADMIN - CAP_SYS_ADMIN
oomScoreAdj: -800 oomScoreAdj: -800
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp:/etc - /tmp:/etc

View File

@ -24,7 +24,7 @@ daemon:
oomScoreAdj: -800 oomScoreAdj: -800
readonly: true readonly: true
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp:/etc - /tmp:/etc

View File

@ -24,7 +24,7 @@ daemon:
oomScoreAdj: -800 oomScoreAdj: -800
readonly: true readonly: true
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp/etc:/etc - /tmp/etc:/etc

View File

@ -1,5 +0,0 @@
bin
dev
proc
sys
usr

View File

@ -7,8 +7,6 @@ RUN \
openrc \ openrc \
&& true && true
ADD dhcpcd.conf /dhcpcd.conf COPY . .
ADD start_dhcpcd.sh /usr/local/bin/start_dhcpcd.sh
ADD 10-mtu /usr/lib/dhcpcd/dhcpcd-hooks/10-mtu
CMD ["/usr/local/bin/start_dhcpcd.sh"] CMD ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf"]

View File

@ -5,7 +5,7 @@ IMAGE=dhcpcd
BASE=alpine:3.5 BASE=alpine:3.5
DEPS=dhcpcd.conf 10-mtu start_dhcpcd.sh DEPS=dhcpcd.conf usr/lib/dhcpcd/dhcpcd-hooks/10-mtu
container: Dockerfile $(DEPS) container: Dockerfile $(DEPS)
tar cf - $^ | docker build --no-cache -t $(IMAGE):build - tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
@ -13,7 +13,7 @@ container: Dockerfile $(DEPS)
hash: Dockerfile $(DEPS) hash: Dockerfile $(DEPS)
DOCKER_CONTENT_TRUST=1 docker pull $(BASE) DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
tar cf - $^ | docker build --no-cache -t $(IMAGE):build - tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
docker run --rm $(IMAGE):build sh -c '(cat /usr/local/bin/start_dhcpcd.sh /dhcpcd.conf /usr/lib/dhcpcd/dhcpcd-hooks/10-mtu /lib/apk/db/installed) | sha1sum' | sed 's/ .*//' > hash docker run --rm $(IMAGE):build sh -c 'cat $^ /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash
push: hash container push: hash container
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
@ -29,6 +29,6 @@ tag: hash container
rm -f hash rm -f hash
clean: clean:
rm -rf hash $(DIRS) rm -rf hash
.DELETE_ON_ERROR: .DELETE_ON_ERROR:

View File

@ -1,9 +0,0 @@
#!bin/sh
set -ex
ip link set eth0 up
cp /dhcpcd.conf /etc/dhcpcd.conf
exec /sbin/dhcpcd --nobackground

View File

@ -24,7 +24,7 @@ daemon:
oomScoreAdj: -800 oomScoreAdj: -800
readonly: true readonly: true
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp/etc:/etc - /tmp/etc:/etc

View File

@ -11,7 +11,7 @@ system:
- CAP_SYS_ADMIN - CAP_SYS_ADMIN
daemon: daemon:
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp:/etc - /tmp:/etc

View File

@ -16,7 +16,7 @@ system:
readonly: true readonly: true
daemon: daemon:
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp:/etc - /tmp:/etc

View File

@ -23,7 +23,7 @@ daemon:
oomScoreAdj: -800 oomScoreAdj: -800
readonly: true readonly: true
- name: dhcpcd - name: dhcpcd
image: "mobylinux/dhcpcd:57a8ef29d3a910645b2b24c124f9ce9ef53ce703" image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea"
binds: binds:
- /var:/var - /var:/var
- /tmp:/etc - /tmp:/etc