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
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=binfmt
DEPS=Dockerfile Makefile 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)
DEPS=main.go $(wildcard etc/binmft.d/*)

View File

@ -1,15 +1,3 @@
.PHONY: tag push
include ../package.mk
ORG?=linuxkit
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
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)
NETWORK=1

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
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 $(ORG)/$(IMAGE):$(HASH) .
push: tag
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)
DEPS=dhcpcd.conf $(wildcard usr/lib/dhcpcd/dhcpcd-hooks/*)

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=docker-ce
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)
NETWORK=1

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=format
DEPS=Dockerfile 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)
DEPS=format.sh

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=getty
DEPS=Dockerfile usr/bin/rungetty.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)
DEPS=usr/bin/rungetty.sh $(wildcard etc/*) $(wildcard etc/init.d/*)

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=init
DEPS=Dockerfile init $(wildcard etc/*) $(wildcard etc/init.d/*) usermode-helper.c
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)
DEPS=init usermode-helper.c $(wildcard etc/*) $(wildcard etc/init.d/*)

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=metadata
DEPS=Dockerfile Makefile $(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)
DEPS=$(wildcard *.go)

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=mkimage
DEPS=Dockerfile 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)
DEPS=mkimage.sh

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=mount
DEPS=Dockerfile 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)
DEPS=mount.sh

View File

@ -1,15 +1,3 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
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
default: push
include ../package.mk
ORG?=linuxkit
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
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=openntpd
DEPS=Dockerfile 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)
DEPS=etc/ntpd.conf

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
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
default: push
include ../package.mk
ORG?=linuxkit
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
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)
NETWORK=1

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=sshd
DEPS=Dockerfile 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)
DEPS=etc/motd etc/ssh/sshd_config usr/bin/ssh.sh

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=swap
DEPS=Dockerfile 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)
DEPS=swap.sh

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=sysctl
DEPS=Dockerfile Makefile 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)
DEPS=main.go

View File

@ -1,15 +1,4 @@
.PHONY: tag push
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=sysfs
DEPS=Dockerfile Makefile 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)
DEPS=main.go

View File

@ -1,15 +1,5 @@
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=vpnkit-forwarder
DEPS=$(wildcard *.go) Makefile 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)
DEPS=$(wildcard *.go)
NETWORK=1

View File

@ -1,15 +1,5 @@
default: push
include ../package.mk
ORG?=linuxkit
IMAGE=vsudd
DEPS=$(wildcard *.go) Makefile 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)
DEPS=$(wildcard *.go)
NETWORK=1