Skip to content

Commit 66b11ac

Browse files
committed
docker: build and push for each architecture
1 parent 314b0bf commit 66b11ac

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

.github/workflows/build_and_push_images.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ jobs:
2626
- "php"
2727
- "python"
2828
- "ruby"
29+
arch:
30+
- "arm64v8"
31+
- "armv7l"
32+
- "ppc64le"
33+
- "s390x"
34+
- "x86_64"
2935
env:
3036
ISHOCON_APP_LANG: ${{ matrix.language }}
3137
UNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
38+
ARCH: ${{ matrix.arch }}
3239
steps:
3340
- uses: actions/checkout@v4
34-
- name: Replace base image in docker-compose.yml with github actor name
35-
run: |
36-
make change-lang
37-
sed -i 's/ishocon2-app-base/${{ env.UNAME }}\/ishocon2-app-base/g' ./docker-compose.yml
38-
cat ./docker-compose.yml
3941
- name: Set up Docker Buildx
4042
uses: docker/setup-buildx-action@v3
4143
- name: Login to Docker Hub
@@ -52,7 +54,6 @@ jobs:
5254
tags: ${{ env.UNAME }}/ishocon2-app-bench:latest
5355
cache-from: type=gha
5456
cache-to: type=gha,mode=max
55-
platforms: linux/amd64,linux/arm64,linux/arm64/v8
5657
- name: Build and push base image
5758
uses: docker/build-push-action@v5
5859
with:

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ ifeq ($(UNAME),)
33
UNAME = $(shell whoami)
44
endif
55

6-
ARCH = $(shell uname -m)
6+
ifeq ($(ARCH),)
7+
ARCH = $(shell uname -m)
8+
endif
79

810
UBUNTU_VERSION = 18.04
911
ifeq ($(ARCH), arm64)
1012
BASE_IMAGE = arm64v8/ubuntu:$(UBUNTU_VERSION)
13+
else ifeq ($(ARCH), aarch64)
14+
BASE_IMAGE = arm64v8/ubuntu:$(UBUNTU_VERSION)
15+
else ifeq ($(ARCH), armv7l)
16+
BASE_IMAGE = armv7l/ubuntu:$(UBUNTU_VERSION)
17+
else ifeq ($(ARCH), ppc64le)
18+
BASE_IMAGE = ppc64le/ubuntu:$(UBUNTU_VERSION)
19+
else ifeq ($(ARCH), s390x)
20+
BASE_IMAGE = s390x/ubuntu:$(UBUNTU_VERSION)
1121
else
1222
BASE_IMAGE = ubuntu:$(UBUNTU_VERSION)
1323
endif
@@ -19,7 +29,7 @@ build-base:
1929
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
2030
-f ./docker/app/base/Dockerfile \
2131
-t $(LOCAL_ISHOCON_BASE_IMAGE) \
22-
-t $(UNAME)/ishocon2-app-base:latest .;
32+
-t $(UNAME)/ishocon2-app-base:latest . --no-cache --progress=plain;
2333

2434
build-bench:
2535
docker build \

0 commit comments

Comments
 (0)