Skip to content

Commit

Permalink
arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
epomatti committed Dec 16, 2023
1 parent 7d00abf commit b7c1840
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/dockerhub-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Dockerhub ARM64

on:
workflow_dispatch:

env:
REPOSITORY: stressbox:arm64

jobs:

build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./app
steps:
- uses: docker/setup-qemu-action@v3
with:
platforms: 'arm64,arm'
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile.arm64v8 --tag $REPOSITORY

- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- run: |
docker tag $REPOSITORY epomatti/$REPOSITORY
docker push epomatti/$REPOSITORY
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.21.5'

- name: Build
run: go build -v ./...
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


FROM golang:1.21-alpine AS builder

WORKDIR /build
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile.arm64v8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://github.com/golang/go/wiki/GoArm
# https://hub.docker.com/r/arm64v8/alpine/tags
FROM arm64v8/golang:1.21-alpine AS builder

WORKDIR /build
COPY . .
RUN go mod download
RUN go build .

FROM arm64v8/golang:1.21-alpine

# curl added only for health check if anyone needs it
RUN apk update && apk add curl
WORKDIR /app
COPY --from=builder /build/stressbox .

ENTRYPOINT ["/app/stressbox"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Pull the image:
docker pull ghcr.io/epomatti/stressbox
```

An `ARM64` release is now available on Docker Hub:

```sh
docker pull epomatti/stressbox:arm64
```

Start the container:

> 💡 Add `-e port=<PORT>` to start the listener in another port
Expand Down

0 comments on commit b7c1840

Please sign in to comment.