commit
168fbcc873
|
@ -0,0 +1 @@
|
||||||
|
bin
|
|
@ -0,0 +1 @@
|
||||||
|
bin
|
32
Makefile
32
Makefile
|
@ -1,7 +1,37 @@
|
||||||
|
|
||||||
|
BINARIES=bin/buildd-standalone bin/buildd-containerd bin/buildctl bin/buildctl-darwin
|
||||||
|
|
||||||
|
binaries: $(BINARIES)
|
||||||
|
|
||||||
|
bin/buildctl-darwin: FORCE
|
||||||
|
mkdir -p bin
|
||||||
|
docker build --build-arg GOOS=darwin -t buildkit_poc:buildctl-darwin --target buildctl -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
||||||
|
( containerID=$$(docker create buildkit_poc:buildctl-darwin noop); \
|
||||||
|
docker cp $$containerID:/usr/bin/buildctl $@; \
|
||||||
|
docker rm $$containerID )
|
||||||
|
chmod +x $@
|
||||||
|
|
||||||
|
bin/%: FORCE
|
||||||
|
mkdir -p bin
|
||||||
|
docker build -t buildkit_poc:$* --target $* -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
||||||
|
( containerID=$$(docker create buildkit_poc:$* noop); \
|
||||||
|
docker cp $$containerID:/usr/bin/$* $@; \
|
||||||
|
docker rm $$containerID )
|
||||||
|
chmod +x $@
|
||||||
|
|
||||||
test:
|
test:
|
||||||
./hack/test
|
./hack/test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
./hack/lint
|
||||||
|
|
||||||
|
validate-vendor:
|
||||||
|
./hack/validate-vendor
|
||||||
|
|
||||||
|
validate-all: test lint validate-vendor
|
||||||
|
|
||||||
vendor:
|
vendor:
|
||||||
./hack/update-vendor
|
./hack/update-vendor
|
||||||
|
|
||||||
.PHONY: vendor test
|
.PHONY: vendor test binaries lint validate-all validate-vendor
|
||||||
|
FORCE:
|
|
@ -1,4 +1,4 @@
|
||||||
// +build linux standalone
|
// +build linux,standalone
|
||||||
|
|
||||||
package control
|
package control
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,25 @@ RUN git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.c
|
||||||
&& git checkout -q "$RUNC_VERSION" \
|
&& git checkout -q "$RUNC_VERSION" \
|
||||||
&& make bin/containerd
|
&& make bin/containerd
|
||||||
|
|
||||||
FROM gobuild-base
|
FROM gobuild-base AS unit-tests
|
||||||
COPY --from=runc /usr/bin/runc /usr/bin/runc
|
COPY --from=runc /usr/bin/runc /usr/bin/runc
|
||||||
COPY --from=containerd /go/src/github.com/containerd/containerd/bin/containerd /usr/bin/containerd
|
COPY --from=containerd /go/src/github.com/containerd/containerd/bin/containerd /usr/bin/containerd
|
||||||
WORKDIR /go/src/github.com/tonistiigi/buildkit_poc
|
WORKDIR /go/src/github.com/tonistiigi/buildkit_poc
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go build -o /usr/bin/buildd-standalone -tags standalone ./cmd/buildd
|
|
||||||
RUN go build -o /usr/bin/buildd-containerd -tags containerd ./cmd/buildd
|
FROM unit-tests AS buildctl
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
|
ARG GOOS=linux
|
||||||
|
RUN go build -ldflags '-d' -o /usr/bin/buildctl ./cmd/buildctl
|
||||||
|
|
||||||
|
FROM unit-tests AS buildd-standalone
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
|
RUN go build -ldflags '-d' -o /usr/bin/buildd-standalone -tags standalone ./cmd/buildd
|
||||||
|
|
||||||
|
FROM unit-tests AS buildd-containerd
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
|
RUN go build -ldflags '-d' -o /usr/bin/buildd-containerd -tags containerd ./cmd/buildd
|
||||||
|
|
||||||
|
FROM unit-tests AS integration-tests
|
||||||
|
COPY --from=buildd-containerd /usr/bin/buildd-containerd /usr/bin
|
||||||
|
COPY --from=buildd-standalone /usr/bin/buildd-standalone /usr/bin
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
set -eu -o pipefail -x
|
set -eu -o pipefail -x
|
||||||
|
|
||||||
# update this to iidfile after 17.06
|
./hack/test-unit
|
||||||
docker build -t buildkit_poc:test -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
./hack/test-binaries
|
||||||
docker run -v /tmp --privileged buildkit_poc:test go test ${TESTFLAGS:--v -tags 'containerd standalone'} ${TESTPKGS:-./...}
|
./hack/test-integration
|
||||||
docker run --rm buildkit_poc:test go build ./...
|
|
||||||
docker run --rm buildkit_poc:test go build -tags standalone ./cmd/buildd
|
|
||||||
docker run --rm buildkit_poc:test go build -tags containerd ./cmd/buildd
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eu -o pipefail -x
|
||||||
|
|
||||||
|
# update this to iidfile after 17.06
|
||||||
|
docker build -t buildkit_poc:test --target unit-tests -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
||||||
|
docker run --rm buildkit_poc:test go build ./...
|
||||||
|
docker run -e GOOS=darwin --rm buildkit_poc:test go build ./cmd/buildctl
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eu -o pipefail -x
|
||||||
|
|
||||||
|
# update this to iidfile after 17.06
|
||||||
|
docker build -t buildkit_poc:test -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
||||||
|
docker run --rm -v /tmp --privileged buildkit_poc:test go test -tags 'containerd standalone' ./client
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eu -o pipefail -x
|
||||||
|
|
||||||
|
# update this to iidfile after 17.06
|
||||||
|
docker build -t buildkit_poc:test --target unit-tests -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
||||||
|
docker run --rm -v /tmp --privileged buildkit_poc:test go test ${TESTFLAGS:--v} ${TESTPKGS:-./...}
|
||||||
|
|
Loading…
Reference in New Issue