Implement package build, push and show-tag in linuxkit tool

This implements the proposal in #2564 and converts a handful of representative
or especially interesting (from a build PoV) packages to use it.

For now those pkg/* affected get a stub-`Makefile`, once all packages are
converted then `pkg/Makefile` can be adjusted and those stubs can be removed.

For now only `pkg/package.mk`'s functionality is implemented. In particular:

- `push-manifest.sh` remains a separate script, to enable calling it on systems
  with just the LinuxKit tools installed arrange to install it under a less
  generic name.
- `kernel` and `tools/alpine` do not use `pkg/package.mk` and those cases are
  not yet fully considered/covered.

I have updated the documentation assuming that the existing uses of
`pkg/package.mk` will be removed quite soon in a follow up PR rather than
trying to document the situation which results after just this commit.

Due to `cmd/linuxkit` now gaining a library the build needs adjusting slightly to
allow both `make bin/linuxkit` and `go build` to work.

`go vet` has forced me to write some rather asinine comments for things that
are rather obvious from the name.

Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
Ian Campbell
2017-10-04 16:25:38 +01:00
parent f8b80b6f00
commit ba60937754
37 changed files with 10221 additions and 27 deletions

View File

@@ -1,11 +1,22 @@
ORG?=linuxkitprojects
IMAGE=kubernetes-image-cache-$(CACHE)
NOTRUST=1
SOURCE=$(BUILDDIR)
DEPS=$(BUILDDIR)/Dockerfile
ARCHES=x86_64
$(BUILDDIR)/build.yml: build.yml.in
@sed -e 's/@@CACHE@@/$(CACHE)/g' < $< > $@
$(BUILDDIR)/Dockerfile: Dockerfile
cp $< $@
@cp $< $@
include ../../../pkg/package.mk
.PHONY: push forcepush tag forcetag show-tag
push: $(BUILDDIR)/build.yml $(BUILDDIR)/Dockerfile
linuxkit pkg push -hash-path . $(BUILDDIR)
forcepush: $(BUILDDIR)/build.yml $(BUILDDIR)/Dockerfile
linuxkit pkg push -force -hash-path . $(BUILDDIR)
tag: $(BUILDDIR)/build.yml $(BUILDDIR)/Dockerfile
linuxkit pkg build -hash-path . $(BUILDDIR)
forcetag: $(BUILDDIR)/build.yml $(BUILDDIR)/Dockerfile
linuxkit pkg build --force -hash-path . $(BUILDDIR)
show-tag: $(BUILDDIR)/build.yml $(BUILDDIR)/Dockerfile
@linuxkit pkg show-tag -hash-path . $(BUILDDIR)

View File

@@ -0,0 +1,5 @@
org: linuxkitprojects
image: kubernetes-image-cache-@@CACHE@@
trust: false
arches:
- amd64