mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-02 13:49:35 +00:00
Also add ca-certificates to base, needed to use `dist` to pull. Make two stage builds for `containerd` and `runc` so they have a from `scratch` second stage. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
34 lines
926 B
Makefile
34 lines
926 B
Makefile
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
|
|
|
|
.PHONY: tag push
|
|
|
|
BASE=golang:1.7-alpine3.5
|
|
IMAGE=runc
|
|
|
|
default: push
|
|
|
|
hash: Dockerfile
|
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build0 -
|
|
docker run --rm $(IMAGE):build0 | docker build --no-cache -t $(IMAGE):build -
|
|
docker rmi $(IMAGE):build0
|
|
find $^ -type f | xargs cat | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > $@
|
|
|
|
push: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
|
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
tag: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
clean:
|
|
rm -f hash
|
|
|
|
.DELETE_ON_ERROR:
|