Skip to content

Commit

Permalink
build arm64 (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: liuyu <>
  • Loading branch information
eball authored Jun 19, 2024
1 parent e8e79e2 commit c2d0250
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 20 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release-dc-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -24,4 +31,5 @@ jobs:
with:
push: true
tags: beclab/go-dev:${{ github.event.inputs.tags }}
file: containers/Dockerfile.dev.go
file: containers/Dockerfile.dev.go
platforms: linux/amd64,linux/arm64
10 changes: 9 additions & 1 deletion .github/workflows/release-dc-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -24,4 +31,5 @@ jobs:
with:
push: true
tags: beclab/node-ts-dev:${{ github.event.inputs.tags }}
file: containers/Dockerfile.dev.node-ts
file: containers/Dockerfile.dev.node-ts
platforms: linux/amd64,linux/arm64
10 changes: 9 additions & 1 deletion .github/workflows/release-dc-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -24,4 +31,5 @@ jobs:
with:
push: true
tags: beclab/python-dev:${{ github.event.inputs.tags }}
file: containers/Dockerfile.dev.python
file: containers/Dockerfile.dev.python
platforms: linux/amd64,linux/arm64
23 changes: 9 additions & 14 deletions .github/workflows/release-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,24 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Download release check-chart
uses: dsaltares/fetch-gh-release-asset@master
with:
file: check-chart_0.0.1_linux_amd64.tar.gz
repo: beclab/check-chart
target: check-chart.tar.gz
version: tags/v0.0.1
token: ${{ secrets.DOWNLOAD_TOKEN }}

- name: unpack check-chart
run: |
tar zxvf check-chart.tar.gz
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
context: .
tags: beclab/devbox-server:${{ github.event.inputs.tags }}
file: Dockerfile.server
file: Dockerfile.server
platforms: linux/amd64,linux/arm64
10 changes: 9 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -43,4 +50,5 @@ jobs:
context: .
push: true
tags: beclab/devbox:${{ github.event.inputs.tags }}
file: Dockerfile
file: Dockerfile
platforms: linux/amd64,linux/arm64
15 changes: 13 additions & 2 deletions Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
FROM golang:1.20.2 AS builder
ARG CHECK_CHART_VERSION=0.0.2

RUN apt-get update && apt-get install -y gcc git musl-dev musl-tools
RUN apt-get update && apt-get install -y gcc git musl-dev musl-tools wget

WORKDIR /workspace
COPY . .

RUN case `uname -m` in \
x86_64) ARCH=amd64; ;; \
armv7l) ARCH=arm; ;; \
aarch64) ARCH=arm64; ;; \
ppc64le) ARCH=ppc64le; ;; \
s390x) ARCH=s390x; ;; \
*) echo "un-supported arch, exit ..."; exit 1; ;; \
esac && \
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

RUN go mod download
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
RUN CGO_ENABLED=1 CC=musl-gcc CGO_LDFLAGS="-static" go build -ldflags="-s -w" -a -o devbox cmd/devbox/main.go


FROM alpine:latest as builder2
Expand Down

0 comments on commit c2d0250

Please sign in to comment.