Merge pull request #2080 from dave-tucker/pkg-mk

Simplify Makefiles for Packages
This commit is contained in:
Rolf Neugebauer 2017-06-22 13:35:43 +01:00 committed by GitHub
commit d65bb86c37
24 changed files with 60 additions and 298 deletions

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=binfmt IMAGE=binfmt
DEPS=Dockerfile Makefile main.go $(wildcard etc/binmft.d/*) DEPS=main.go $(wildcard etc/binmft.d/*)
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,3 @@
.PHONY: tag push include ../package.mk
ORG?=linuxkit
IMAGE=ca-certificates IMAGE=ca-certificates
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
default: push
tag: Dockerfile
docker build --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
ORG?=linuxkit
IMAGE=containerd IMAGE=containerd
NETWORK=1
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
default: push
tag: Dockerfile
docker build -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=dhcpcd IMAGE=dhcpcd
DEPS=Dockerfile Makefile dhcpcd.conf usr/lib/dhcpcd/dhcpcd-hooks/10-mtu DEPS=dhcpcd.conf $(wildcard usr/lib/dhcpcd/dhcpcd-hooks/*)
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=docker-ce IMAGE=docker-ce
DEPS=Dockerfile NETWORK=1
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=format IMAGE=format
DEPS=Dockerfile format.sh DEPS=format.sh
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=getty IMAGE=getty
DEPS=Dockerfile usr/bin/rungetty.sh DEPS=usr/bin/rungetty.sh $(wildcard etc/*) $(wildcard etc/init.d/*)
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=init IMAGE=init
DEPS=Dockerfile init $(wildcard etc/*) $(wildcard etc/init.d/*) usermode-helper.c DEPS=init usermode-helper.c $(wildcard etc/*) $(wildcard etc/init.d/*)
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=metadata IMAGE=metadata
DEPS=Dockerfile Makefile $(wildcard *.go) DEPS=$(wildcard *.go)
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=mkimage IMAGE=mkimage
DEPS=Dockerfile mkimage.sh DEPS=mkimage.sh
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=mount IMAGE=mount
DEPS=Dockerfile mount.sh DEPS=mount.sh
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,3 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=node_exporter IMAGE=node_exporter
DEPS=Dockerfile
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,3 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=open-vm-tools IMAGE=open-vm-tools
DEPS=Dockerfile Makefile
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=openntpd IMAGE=openntpd
DEPS=Dockerfile etc/ntpd.conf DEPS=etc/ntpd.conf
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

17
pkg/package.mk Normal file
View File

@ -0,0 +1,17 @@
.PHONY: tag push
default: push
ORG?=linuxkit
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
BASE_DEPS=Dockerfile Makefile
tag: $(BASE_DEPS) $(DEPS)
ifndef $(NETWORK)
docker build -t $(ORG)/$(IMAGE):$(HASH) .
else
docker build --network=none -t $(ORG)/$(IMAGE):$(HASH) .
endif
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,14 +1,3 @@
.PHONY: tag push include ../package.mk
ORG?=linuxkit
IMAGE=qemu-ga IMAGE=qemu-ga
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
default: push
tag: Dockerfile
docker build --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
docker pull $(ORG)/$(IMAGE):$(HASH) || docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,3 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=rngd IMAGE=rngd
DEPS=Dockerfile
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
ORG?=linuxkit
IMAGE=runc IMAGE=runc
NETWORK=1
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
default: push
tag: Dockerfile
docker build -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=sshd IMAGE=sshd
DEPS=Dockerfile etc/motd etc/ssh/sshd_config usr/bin/ssh.sh DEPS=etc/motd etc/ssh/sshd_config usr/bin/ssh.sh
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=swap IMAGE=swap
DEPS=Dockerfile swap.sh DEPS=swap.sh
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=sysctl IMAGE=sysctl
DEPS=Dockerfile Makefile main.go DEPS=main.go
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,4 @@
.PHONY: tag push include ../package.mk
default: push
ORG?=linuxkit
IMAGE=sysfs IMAGE=sysfs
DEPS=Dockerfile Makefile main.go DEPS=main.go
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache --network=none -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,5 @@
default: push include ../package.mk
ORG?=linuxkit
IMAGE=vpnkit-forwarder IMAGE=vpnkit-forwarder
DEPS=$(wildcard *.go) Makefile Dockerfile DEPS=$(wildcard *.go)
NETWORK=1
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)

View File

@ -1,15 +1,5 @@
default: push include ../package.mk
ORG?=linuxkit
IMAGE=vsudd IMAGE=vsudd
DEPS=$(wildcard *.go) Makefile Dockerfile DEPS=$(wildcard *.go)
NETWORK=1
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
tag: $(DEPS)
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)