Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 743f7fc

Browse files
Also introduce armhf support for docker app plugin and cnab-app-base invocation image.
Signed-off-by: Silvin Lubecki <[email protected]>
1 parent ce29c19 commit 743f7fc

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN git clone https://github.com/docker/cli . && git checkout v${CLI_VERSION}
1414
RUN mkdir build
1515
RUN curl -fL https://download.docker.com/linux/static/${CLI_CHANNEL}/x86_64/docker-${CLI_VERSION}.tgz | tar xzO docker/docker > build/docker-linux-amd64 && chmod +x build/docker-linux-amd64
1616
RUN curl -fL https://download.docker.com/linux/static/${CLI_CHANNEL}/aarch64/docker-${CLI_VERSION}.tgz | tar xzO docker/docker > build/docker-linux-arm64 && chmod +x build/docker-linux-arm64
17+
RUN curl -fL https://download.docker.com/linux/static/${CLI_CHANNEL}/armhf/docker-${CLI_VERSION}.tgz | tar xzO docker/docker > build/docker-linux-arm && chmod +x build/docker-linux-arm
1718
RUN curl -fL https://download.docker.com/mac/static/${CLI_CHANNEL}/x86_64/docker-${CLI_VERSION}.tgz | tar xzO docker/docker > build/docker-darwin-amd64
1819

1920
ARG GOPROXY
@@ -68,6 +69,7 @@ FROM scratch AS cross
6869
ARG PROJECT_PATH=/go/src/github.com/docker/app
6970
COPY --from=cross-build ${PROJECT_PATH}/bin/docker-app-linux docker-app-linux
7071
COPY --from=cross-build ${PROJECT_PATH}/bin/docker-app-linux-arm64 docker-app-linux-arm64
72+
COPY --from=cross-build ${PROJECT_PATH}/bin/docker-app-linux-arm docker-app-linux-arm
7173
COPY --from=cross-build ${PROJECT_PATH}/bin/docker-app-darwin docker-app-darwin
7274
COPY --from=cross-build ${PROJECT_PATH}/bin/docker-app-windows.exe docker-app-windows.exe
7375

Jenkinsfile.baguette

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pipeline {
7171
dir('_build') {
7272
stash name: 'invocation-image', includes: 'invocation-image.tar'
7373
stash name: 'invocation-image-arm64', includes: 'invocation-image-arm64.tar'
74+
stash name: 'invocation-image-arm', includes: 'invocation-image-arm.tar'
7475
stash name: 'coverage-invocation-image', includes: 'coverage-invocation-image.tar'
7576
archiveArtifacts 'invocation-image*.tar'
7677
}
@@ -80,6 +81,7 @@ pipeline {
8081
always {
8182
sh 'docker rmi docker/cnab-app-base:$TAG'
8283
sh 'docker rmi docker/cnab-app-base:$TAG-arm64'
84+
sh 'docker rmi docker/cnab-app-base:$TAG-arm'
8385
sh 'docker rmi docker/cnab-app-base:$TAG-coverage'
8486
deleteDir()
8587
}
@@ -254,6 +256,8 @@ pipeline {
254256
sh 'docker load -i invocation-image.tar'
255257
unstash "invocation-image-arm64"
256258
sh 'docker load -i invocation-image-arm64.tar'
259+
unstash "invocation-image-arm"
260+
sh 'docker load -i invocation-image-arm.tar'
257261
}
258262
ansiColor('xterm') {
259263
sh 'make -f docker.Makefile push-invocation-image'
@@ -269,6 +273,7 @@ pipeline {
269273
always {
270274
sh 'docker rmi docker/cnab-app-base:$TAG'
271275
sh 'docker rmi docker/cnab-app-base:$TAG-arm64'
276+
sh 'docker rmi docker/cnab-app-base:$TAG-arm'
272277
deleteDir()
273278
}
274279
}

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ check_go_env:
3737

3838
cross: cross-plugin ## cross-compile binaries (linux, darwin, windows)
3939

40-
cross-plugin: bin/$(BIN_NAME)-linux bin/$(BIN_NAME)-darwin bin/$(BIN_NAME)-windows.exe bin/$(BIN_NAME)-linux-arm64
40+
cross-plugin: bin/$(BIN_NAME)-linux bin/$(BIN_NAME)-darwin bin/$(BIN_NAME)-windows.exe bin/$(BIN_NAME)-linux-arm64 bin/$(BIN_NAME)-linux-arm
4141

4242
e2e-cross: bin/$(BIN_NAME)-e2e-linux bin/$(BIN_NAME)-e2e-darwin bin/$(BIN_NAME)-e2e-windows.exe
4343

@@ -53,6 +53,10 @@ bin/$(BIN_NAME)-e2e-%.exe bin/$(BIN_NAME)-e2e-%: e2e bin/$(BIN_NAME)-%
5353
bin/$(BIN_NAME)-linux-arm64: cmd/$(BIN_NAME) check_go_env
5454
GOOS=linux GOARCH=arm64 $(GO_BUILD) -o $@ ./$<
5555

56+
.PHONY: bin/$(BIN_NAME)-linux-arm
57+
bin/$(BIN_NAME)-linux-arm: cmd/$(BIN_NAME) check_go_env
58+
GOOS=linux GOARCH=arm $(GO_BUILD) -o $@ ./$<
59+
5660
.PHONY: bin/$(BIN_NAME)-windows
5761
bin/$(BIN_NAME)-%.exe bin/$(BIN_NAME)-%: cmd/$(BIN_NAME) check_go_env
5862
GOOS=$* $(GO_BUILD) -o $@ ./$<

docker.Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cross: create_bin ## cross-compile binaries (linux, darwin, windows)
4040
docker build $(BUILD_ARGS) --output type=local,dest=./bin/ --target=cross -t $(CROSS_IMAGE_NAME) .
4141
@$(call chmod,+x,bin/$(BIN_NAME)-linux)
4242
@$(call chmod,+x,bin/$(BIN_NAME)-linux-arm64)
43+
@$(call chmod,+x,bin/$(BIN_NAME)-linux-arm)
4344
@$(call chmod,+x,bin/$(BIN_NAME)-darwin)
4445
@$(call chmod,+x,bin/$(BIN_NAME)-windows.exe)
4546

@@ -62,6 +63,7 @@ tars:
6263
tar --transform='flags=r;s|$(BIN_NAME)-linux|$(BIN_NAME)-plugin-linux|' -czf bin/$(BIN_NAME)-linux.tar.gz -C bin $(BIN_NAME)-linux
6364
tar czf bin/$(BIN_NAME)-e2e-linux.tar.gz -C bin $(BIN_NAME)-e2e-linux
6465
tar --transform='flags=r;s|$(BIN_NAME)-linux-arm64|$(BIN_NAME)-plugin-linux-arm64|' -czf bin/$(BIN_NAME)-linux-arm64.tar.gz -C bin $(BIN_NAME)-linux-arm64
66+
tar --transform='flags=r;s|$(BIN_NAME)-linux-arm|$(BIN_NAME)-plugin-linux-arm|' -czf bin/$(BIN_NAME)-linux-arm.tar.gz -C bin $(BIN_NAME)-linux-arm
6567
tar --transform='flags=r;s|$(BIN_NAME)-darwin|$(BIN_NAME)-plugin-darwin|' -czf bin/$(BIN_NAME)-darwin.tar.gz -C bin $(BIN_NAME)-darwin
6668
tar czf bin/$(BIN_NAME)-e2e-darwin.tar.gz -C bin $(BIN_NAME)-e2e-darwin
6769
tar --transform='flags=r;s|$(BIN_NAME)-windows|$(BIN_NAME)-plugin-windows|' -czf bin/$(BIN_NAME)-windows.tar.gz -C bin $(BIN_NAME)-windows.exe
@@ -126,7 +128,10 @@ invocation-image:
126128
invocation-image-arm64:
127129
docker build -f Dockerfile.invocation-image $(BUILD_ARGS) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64 --platform=arm64 .
128130

129-
invocation-image-cross: invocation-image invocation-image-arm64
131+
invocation-image-arm:
132+
docker build -f Dockerfile.invocation-image $(BUILD_ARGS) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME)-arm --platform=arm .
133+
134+
invocation-image-cross: invocation-image invocation-image-arm64 invocation-image-arm
130135

131136
save-invocation-image-tag:
132137
docker tag $(CNAB_BASE_INVOCATION_IMAGE_NAME) docker/cnab-app-base:$(INVOCATION_IMAGE_TAG)
@@ -138,6 +143,7 @@ save-invocation-image:
138143

139144
save-invocation-image-cross: save-invocation-image
140145
docker save $(CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64 -o $(CNAB_BASE_INVOCATION_IMAGE_PATH)-arm64.tar
146+
docker save $(CNAB_BASE_INVOCATION_IMAGE_NAME)-arm -o $(CNAB_BASE_INVOCATION_IMAGE_PATH)-arm.tar
141147

142148
push-invocation-image:
143149
# tag and push linux/amd64
@@ -146,11 +152,14 @@ push-invocation-image:
146152
# tag and push linux/arm64
147153
docker tag $(CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64 $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64
148154
docker push $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64
155+
# tag and push linux/armhf
156+
docker tag $(CNAB_BASE_INVOCATION_IMAGE_NAME)-arm $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm
157+
docker push $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm
149158
# create and push manifest list
150-
docker manifest create $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64
159+
docker manifest create $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm64 $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)-arm
151160
docker manifest push $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME)
152161

153162
help: ## this help
154163
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
155164

156-
.PHONY: lint test-e2e test-unit test cli-cross cross e2e-cross coverage coverage-run coverage-results shell build_dev_image tars vendor check-vendor schemas help invocation-image invocation-image-arm64 invocation-image-cross save-invocation-image save-invocation-image-tag push-invocation-image
165+
.PHONY: lint test-e2e test-unit test cli-cross cross e2e-cross coverage coverage-run coverage-results shell build_dev_image tars vendor check-vendor schemas help invocation-image invocation-image-arm invocation-image-arm64 invocation-image-cross save-invocation-image save-invocation-image-tag push-invocation-image

0 commit comments

Comments
 (0)