Merge pull request #466 from justincormack/more-repro

[WIP] closer to reproducible builds
This commit is contained in:
Justin Cormack 2016-09-06 13:20:51 +01:00 committed by GitHub
commit 2b80c19731
15 changed files with 113 additions and 45 deletions

View File

@ -1,26 +1,10 @@
.PHONY: tag push
DIRS = alpine-base alpine-build-c alpine-build-go
.PHONY: clean dirs $(DIRS)
default: push
push: $(DIRS)
hash:
docker pull alpine:3.4
tar cf - Dockerfile | docker build --no-cache -t mobylinux/alpine-base:build -
rm -f hash
docker run mobylinux/alpine-base:build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
push: hash
docker pull mobylinux/alpine-base:$(shell cat hash) || \
(docker tag mobylinux/alpine-base:build mobylinux/alpine-base:latest && \
docker tag mobylinux/alpine-base:build mobylinux/alpine-base:$(shell cat hash) && \
docker push mobylinux/alpine-base:$(shell cat hash) && \
docker push mobylinux/alpine-base:latest)
rm -f hash
tag: hash
docker pull mobylinux/alpine-base:$(shell cat hash) || \
(docker tag mobylinux/alpine-base:build mobylinux/alpine-base:latest && \
docker tag mobylinux/alpine-base:build mobylinux/alpine-base:$(shell cat hash))
rm -f hash
$(DIRS):
$(MAKE) -C $@
clean:
rm -f hash

View File

@ -0,0 +1,32 @@
.PHONY: tag push
BASE=alpine:3.4
IMAGE=alpine-base
default: push
hash:
docker pull $(BASE)
tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build -
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
push: hash
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
docker push mobylinux/$(IMAGE):$(shell cat hash) && \
docker push mobylinux/$(IMAGE):latest)
docker rmi $(IMAGE):build
rm -f hash
tag: hash
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash))
docker rmi $(IMAGE):build
rm -f hash
clean:
rm -f hash
.DELETE_ON_ERROR:

View File

@ -0,0 +1,2 @@
FROM alpine:3.4
RUN apk update && apk upgrade && apk add build-base util-linux-dev linux-headers

View File

@ -0,0 +1,32 @@
.PHONY: tag push
BASE=alpine:3.4
IMAGE=alpine-build-c
default: push
hash:
docker pull $(BASE)
tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build -
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
push: hash
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
docker push mobylinux/$(IMAGE):$(shell cat hash) && \
docker push mobylinux/$(IMAGE):latest)
docker rmi $(IMAGE):build
rm -f hash
tag: hash
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash))
docker rmi $(IMAGE):build
rm -f hash
clean:
rm -f hash
.DELETE_ON_ERROR:

View File

@ -0,0 +1,2 @@
FROM golang:1.7-alpine
RUN apk update && apk add build-base

View File

@ -0,0 +1,32 @@
.PHONY: tag push
BASE=golang:1.7-alpine
IMAGE=alpine-build-go
default: push
hash:
docker pull $(BASE)
tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build -
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
push: hash
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
docker push mobylinux/$(IMAGE):$(shell cat hash) && \
docker push mobylinux/$(IMAGE):latest)
docker rmi $(IMAGE):build
rm -f hash
tag: hash
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build mobylinux/$(IMAGE):latest && \
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash))
docker rmi $(IMAGE):build
rm -f hash
clean:
rm -f hash
.DELETE_ON_ERROR:

View File

@ -1,6 +1,4 @@
FROM alpine:3.4
RUN apk update && apk upgrade && apk add build-base util-linux-dev linux-headers
FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b
RUN mkdir -p /9pmount-vsock
WORKDIR /9pmount-vsock

View File

@ -1,6 +1,4 @@
FROM golang:alpine
RUN apk update && apk add build-base
FROM mobylinux/alpine-build-go:f87b7d1c1cdec779ed602bfa5eaaeb94896d612c
RUN mkdir -p /go/src/diagnostics
WORKDIR /go/src/diagnostics

View File

@ -1,6 +1,4 @@
FROM alpine:3.4
RUN apk update && apk upgrade && apk add build-base linux-headers
FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b
RUN mkdir -p /hvtools

View File

@ -1,6 +1,4 @@
FROM alpine:3.4
RUN apk update && apk upgrade && apk add build-base util-linux-dev
FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b
RUN mkdir -p /nc-vsock
WORKDIR /nc-vsock

View File

@ -1,6 +1,4 @@
FROM golang:alpine
RUN apk update && apk add build-base
FROM mobylinux/alpine-build-go:f87b7d1c1cdec779ed602bfa5eaaeb94896d612c
RUN mkdir -p /go/src/proxy
WORKDIR /go/src/proxy

View File

@ -1,6 +1,4 @@
FROM alpine:3.4
RUN apk update && apk upgrade && apk add build-base util-linux-dev linux-headers
FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b
RUN mkdir -p /tap-vsockd
WORKDIR /tap-vsockd

View File

@ -1,6 +1,4 @@
FROM alpine:3.4
RUN apk update && apk upgrade && apk add build-base
FROM mobylinux/alpine-build-c:1b53976210ba819823eda5b1d0d3ea337772e97b
RUN mkdir -p /transfused
WORKDIR /transfused

View File

@ -1,6 +1,4 @@
FROM golang:alpine
RUN apk update && apk add build-base
FROM mobylinux/alpine-build-go:f87b7d1c1cdec779ed602bfa5eaaeb94896d612c
RUN mkdir -p /go/src/vsudd
WORKDIR /go/src/vsudd