Skip to content

Commit c2d0250

Browse files
authored
build arm64 (#6)
Co-authored-by: liuyu <>
1 parent e8e79e2 commit c2d0250

File tree

6 files changed

+58
-20
lines changed

6 files changed

+58
-20
lines changed

.github/workflows/release-dc-go.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
- name: Check out the repo
1414
uses: actions/checkout@v3
1515

16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v3
22+
1623
- name: Log in to Docker Hub
1724
uses: docker/login-action@v2
1825
with:
@@ -24,4 +31,5 @@ jobs:
2431
with:
2532
push: true
2633
tags: beclab/go-dev:${{ github.event.inputs.tags }}
27-
file: containers/Dockerfile.dev.go
34+
file: containers/Dockerfile.dev.go
35+
platforms: linux/amd64,linux/arm64

.github/workflows/release-dc-node.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
- name: Check out the repo
1414
uses: actions/checkout@v3
1515

16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v3
22+
1623
- name: Log in to Docker Hub
1724
uses: docker/login-action@v2
1825
with:
@@ -24,4 +31,5 @@ jobs:
2431
with:
2532
push: true
2633
tags: beclab/node-ts-dev:${{ github.event.inputs.tags }}
27-
file: containers/Dockerfile.dev.node-ts
34+
file: containers/Dockerfile.dev.node-ts
35+
platforms: linux/amd64,linux/arm64

.github/workflows/release-dc-python.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
- name: Check out the repo
1414
uses: actions/checkout@v3
1515

16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v3
22+
1623
- name: Log in to Docker Hub
1724
uses: docker/login-action@v2
1825
with:
@@ -24,4 +31,5 @@ jobs:
2431
with:
2532
push: true
2633
tags: beclab/python-dev:${{ github.event.inputs.tags }}
27-
file: containers/Dockerfile.dev.python
34+
file: containers/Dockerfile.dev.python
35+
platforms: linux/amd64,linux/arm64

.github/workflows/release-server.yaml

+9-14
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,24 @@ jobs:
1313
- name: Check out the repo
1414
uses: actions/checkout@v3
1515

16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v3
22+
1623
- name: Log in to Docker Hub
1724
uses: docker/login-action@v2
1825
with:
1926
username: ${{ secrets.DOCKERHUB_USERNAME }}
2027
password: ${{ secrets.DOCKERHUB_PASS }}
2128

22-
- name: Download release check-chart
23-
uses: dsaltares/fetch-gh-release-asset@master
24-
with:
25-
file: check-chart_0.0.1_linux_amd64.tar.gz
26-
repo: beclab/check-chart
27-
target: check-chart.tar.gz
28-
version: tags/v0.0.1
29-
token: ${{ secrets.DOWNLOAD_TOKEN }}
30-
31-
- name: unpack check-chart
32-
run: |
33-
tar zxvf check-chart.tar.gz
34-
3529
- name: Build and push Docker image
3630
uses: docker/build-push-action@v3
3731
with:
3832
push: true
3933
context: .
4034
tags: beclab/devbox-server:${{ github.event.inputs.tags }}
41-
file: Dockerfile.server
35+
file: Dockerfile.server
36+
platforms: linux/amd64,linux/arm64

.github/workflows/release.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
- name: Check out the repo
1414
uses: actions/checkout@v3
1515

16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v3
22+
1623
- name: Log in to Docker Hub
1724
uses: docker/login-action@v2
1825
with:
@@ -43,4 +50,5 @@ jobs:
4350
context: .
4451
push: true
4552
tags: beclab/devbox:${{ github.event.inputs.tags }}
46-
file: Dockerfile
53+
file: Dockerfile
54+
platforms: linux/amd64,linux/arm64

Dockerfile.server

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
FROM golang:1.20.2 AS builder
2+
ARG CHECK_CHART_VERSION=0.0.2
23

3-
RUN apt-get update && apt-get install -y gcc git musl-dev musl-tools
4+
RUN apt-get update && apt-get install -y gcc git musl-dev musl-tools wget
45

56
WORKDIR /workspace
67
COPY . .
78

9+
RUN case `uname -m` in \
10+
x86_64) ARCH=amd64; ;; \
11+
armv7l) ARCH=arm; ;; \
12+
aarch64) ARCH=arm64; ;; \
13+
ppc64le) ARCH=ppc64le; ;; \
14+
s390x) ARCH=s390x; ;; \
15+
*) echo "un-supported arch, exit ..."; exit 1; ;; \
16+
esac && \
17+
wget https://github.com/beclab/check-chart/releases/download/v${CHECK_CHART_VERSION}/check-chart_${CHECK_CHART_VERSION}_linux_${ARCH}.tar.gz -O - | tar -xz
18+
819
RUN go mod download
9-
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=musl-gcc CGO_LDFLAGS="-static" go build -ldflags="-s -w" -a -o devbox cmd/devbox/main.go
20+
RUN CGO_ENABLED=1 CC=musl-gcc CGO_LDFLAGS="-static" go build -ldflags="-s -w" -a -o devbox cmd/devbox/main.go
1021

1122

1223
FROM alpine:latest as builder2

0 commit comments

Comments
 (0)