mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
pkg: Roll the dhcpcd package from linuxkit/alpine
The dhcpcd package only needs a basic alpine-baselayout and dhcpcd. This reduces the size of the package from 4.3MB to 1.8MB. Also make the HUB org/registry build time configurable. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
72c88872e6
commit
92b8d873bf
@ -1,13 +1,18 @@
|
||||
FROM linuxkit/alpine:c5021a113803f7608e3908014d316c3490183d0b@sha256:4c7a80173c71ca5019dc56f40442b3a8345f141dd46593bd1fe6d130294d07cb AS mirror
|
||||
FROM linuxkit/alpine:6336329f15b4166514782eaa555cf0ffd35c519c@sha256:f6c2ce92910b1d6e4e5557850a554f4a3ae9f66c1e89ad86a24d6c6e550f165e AS mirror
|
||||
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
||||
RUN apk add --no-cache --initdb -p /out \
|
||||
alpine-baselayout \
|
||||
busybox \
|
||||
dhcpcd \
|
||||
musl
|
||||
|
||||
FROM alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
|
||||
COPY --from=mirror /etc/apk/repositories /etc/apk/repositories
|
||||
COPY --from=mirror /etc/apk/keys /etc/apk/keys/
|
||||
COPY --from=mirror /mirror /mirror/
|
||||
# Remove apk residuals
|
||||
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
|
||||
|
||||
RUN apk add dhcpcd
|
||||
|
||||
RUN rm -rf /mirror /etc/apk/repositories /etc/apk/keys
|
||||
|
||||
COPY . .
|
||||
FROM scratch
|
||||
ENTRYPOINT []
|
||||
CMD []
|
||||
WORKDIR /
|
||||
COPY --from=mirror /out/ /
|
||||
COPY /dhcpcd.conf /usr/ /
|
||||
CMD ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf"]
|
||||
|
@ -1,14 +1,15 @@
|
||||
.PHONY: tag push
|
||||
default: push
|
||||
|
||||
ORG?=linuxkit
|
||||
IMAGE=dhcpcd
|
||||
DEPS=Dockerfile Makefile dhcpcd.conf usr/lib/dhcpcd/dhcpcd-hooks/10-mtu
|
||||
|
||||
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||
|
||||
tag: $(DEPS)
|
||||
docker build --squash --no-cache --network=none -t linuxkit/$(IMAGE):$(HASH) .
|
||||
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
|
||||
|
||||
push: tag
|
||||
docker pull linuxkit/$(IMAGE):$(HASH) || \
|
||||
docker push linuxkit/$(IMAGE):$(HASH)
|
||||
docker pull $(ORG)/$(IMAGE):$(HASH) || \
|
||||
docker push $(ORG)/$(IMAGE):$(HASH)
|
||||
|
Loading…
Reference in New Issue
Block a user