This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,9 +105,9 @@ go test -v -run "<TEST_NAME>" .
105105```
106106
107107** NOTE** if the tests fail with an error message like `"Error: manifest
108- for docker/cnab-app-base: v0 .6.0-68-g3ae57efdb6-dirty not found"`, it means
109- you forgot to rebuild the base invocation image, simply run
108+ for docker/cnab-app-base: v0 .6.0-68-g3ae57efdb6-dirty not found"`, it means
109+ you forgot to rebuild the base invocation image, simply run
110110
111111``` sh
112- $ make invocation-image
112+ $ make -f docker.Makefile invocation-image
113113```
Original file line number Diff line number Diff line change 1- ARG ALPINE_VERSION=3.8
2- ARG GO_VERSION=1.11.0
3-
41FROM dockercore/golang-cross:1.11.5@sha256:17a7e0f158521c50316a0d0c1ab1f6a75350b4d82e7ef03c98bcfbdf04feb4f3 AS build
52ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
63
@@ -41,16 +38,3 @@ ARG EXPERIMENTAL="off"
4138ARG TAG="unknown"
4239# Run e2e tests
4340RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} e2e-cross
44-
45- # builder of invocation image entrypoint
46- FROM build AS invocation-build
47- COPY . .
48- ARG EXPERIMENTAL="off"
49- RUN make EXPERIMENTAL=${EXPERIMENTAL} bin/cnab-run
50-
51- # cnab invocation image
52- FROM alpine:${ALPINE_VERSION} AS invocation
53- RUN apk add --no-cache ca-certificates
54- COPY --from=invocation-build /go/src/github.com/docker/app/bin/cnab-run /cnab/app/run
55- WORKDIR /cnab/app
56- CMD /cnab/app/run
Original file line number Diff line number Diff line change 11ARG ALPINE_VERSION=3.8
2- ARG GO_VERSION=1.11.0
32
4- FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
5- ARG DOCKERCLI_VERSION=18.03.1-ce
6- ARG DOCKERCLI_CHANNEL=edge
7- RUN apk add --no-cache \
8- make
3+ FROM dockercore/golang-cross:1.11.5@sha256:17a7e0f158521c50316a0d0c1ab1f6a75350b4d82e7ef03c98bcfbdf04feb4f3 AS build
4+
5+ RUN apt-get install -y -q --no-install-recommends \
6+ coreutils \
7+ util-linux \
8+ uuid-runtime
99
1010WORKDIR /go/src/github.com/docker/app/
1111
12- # builder of invocation image entrypoint
13- FROM build AS invocation-build
1412COPY . .
1513ARG EXPERIMENTAL="off"
1614RUN make EXPERIMENTAL=${EXPERIMENTAL} bin/cnab-run
1715
1816 # local cnab invocation image
1917FROM alpine:${ALPINE_VERSION} as invocation
2018RUN apk add --no-cache ca-certificates
21- COPY --from=invocation- build /go/src/github.com/docker/app/bin/cnab-run /cnab/app/run
19+ COPY --from=build /go/src/github.com/docker/app/bin/cnab-run /cnab/app/run
2220WORKDIR /cnab/app
2321CMD /cnab/app/run
Original file line number Diff line number Diff line change 2727GO_BUILD := CGO_ENABLED=0 go build -tags=$(BUILDTAGS ) -ldflags=$(LDFLAGS )
2828GO_TEST := CGO_ENABLED=0 go test -tags=$(BUILDTAGS ) -ldflags=$(LDFLAGS )
2929
30- CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(BUILD_TAG )
31-
3230all : bin/$(BIN_NAME ) test
3331
3432check_go_env :
@@ -99,9 +97,6 @@ specification/bindata.go: specification/schemas/*.json
9997
10098schemas : specification/bindata.go # # generate specification/bindata.go from json schemas
10199
102- invocation-image :
103- docker build -f Dockerfile.invocation-image $(BUILD_ARGS ) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) .
104-
105100help : # # this help
106101 @awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST ) | sort
107102
Original file line number Diff line number Diff line change @@ -15,11 +15,10 @@ E2E_CROSS_CTNR_NAME := $(BIN_NAME)-e2e-cross-$(TAG)
1515COV_CTNR_NAME := $(BIN_NAME ) -cov-$(TAG )
1616SCHEMAS_CTNR_NAME := $(BIN_NAME ) -schemas-$(TAG )
1717
18- BUILD_ARGS=--build-arg=EXPERIMENTAL =$(EXPERIMENTAL ) --build-arg=TAG=$(TAG ) --build-arg=COMMIT=$(COMMIT )
18+ BUILD_ARGS=--build-arg=EXPERIMENTAL =$(EXPERIMENTAL ) --build-arg=TAG=$(TAG ) --build-arg=COMMIT=$(COMMIT ) --build-arg=ALPINE_VERSION= $( ALPINE_VERSION )
1919
2020PKG_PATH := /go/src/$(PKG_NAME )
2121
22- CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(BUILD_TAG )
2322PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(TAG )
2423CNAB_BASE_INVOCATION_IMAGE_PATH := _build/invocation-image.tar
2524
@@ -113,7 +112,7 @@ specification/bindata.go: specification/schemas/*.json build_dev_image
113112schemas : specification/bindata.go # # generate specification/bindata.go from json schemas
114113
115114invocation-image :
116- docker build $(BUILD_ARGS ) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) .
115+ docker build -f Dockerfile.invocation-image $(BUILD_ARGS ) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) .
117116
118117save-invocation-image : invocation-image
119118 @$(call mkdir,_build)
@@ -126,4 +125,4 @@ push-invocation-image:
126125help : # # this help
127126 @awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST ) | sort
128127
129- .PHONY : lint test-e2e test-unit test cli-cross cross e2e-cross coverage gradle-test shell build_dev_image tars vendor schemas help invocation-image save-invocation-image push-invocation-image
128+ .PHONY : lint test-e2e test-unit test cli-cross cross e2e-cross coverage gradle-test shell build_dev_image tars vendor schemas help save-invocation-image push-invocation-image
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ E2E_NAME := $(BIN_NAME)-e2e
55# Enable experimental features. "on" or "off"
66EXPERIMENTAL := off
77
8+ ALPINE_VERSION =3.8
9+
810# Failing to resolve sh.exe to a full path denotes a windows vanilla shell.
911# Although 'simple' commands are still exec'ed, 'complex' ones are batch'ed instead of sh'ed.
1012ifeq ($(SHELL ) ,sh.exe)
3335ifeq ($(TAG ) ,)
3436 TAG := $(BUILD_TAG )
3537endif
38+
39+ CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(BUILD_TAG )
You can’t perform that action at this time.
0 commit comments