chore: multi-arch Docker build (amd64, arm64, armv7) (#4)
* chore: multi-arch Docker build (amd64, arm64, armv7) - Remove hardcoded GOARCH=amd64 from Dockerfile, use TARGETARCH ARG - Add QEMU + buildx to CI for cross-compilation - Build for linux/amd64, linux/arm64, linux/arm/v7 * chore: update action versions, add dependabot - actions/checkout v4 → v6 - actions/setup-go v5 → v6 - Add dependabot.yml (monthly checks for Go, Actions, Docker)
This commit is contained in:
1 parent
2b4340d8b0
commit
159eab5d1c
3 files changed
+53
-4
No files matched your search
@@ -0,0 +1,41 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# Go modules
|
||||||
|
- package-ecosystem: "gomod"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "monthly"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore(deps)"
|
||||||
|
groups:
|
||||||
|
go-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
# GitHub Actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "monthly"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
- "ci"
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore(ci)"
|
||||||
|
groups:
|
||||||
|
actions-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
- package-ecosystem: "docker"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "monthly"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
- "docker"
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore(docker)"
|
||||||
@@ -10,9 +10,9 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
@@ -30,7 +30,11 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -42,4 +46,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
tags: ghcr.io/turbootzz/vaultwarden-api:latest
|
tags: ghcr.io/turbootzz/vaultwarden-api:latest
|
||||||
+4
-1
@@ -8,7 +8,10 @@ COPY go.mod go.sum ./
|
|||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
ARG TARGETOS=linux
|
||||||
|
ARG TARGETARCH=amd64
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
|
||||||
-ldflags="-s -w" \
|
-ldflags="-s -w" \
|
||||||
-o /build/vaultwarden-api \
|
-o /build/vaultwarden-api \
|
||||||
./cmd/api
|
./cmd/api
|
||||||
|
|||||||
Reference in new issue
Block a user