docker multi-arch build

This commit is contained in:
Dimitri Herzog 2021-09-23 21:35:42 +02:00
parent 9f8c31b968
commit b4734e042a
2 changed files with 34 additions and 0 deletions

29
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Docker build
on:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: ghcr.io/0xerr0r/rest-server:latest

View file

@ -11,6 +11,11 @@ RUN go build -o rest-server ./cmd/rest-server
FROM alpine
LABEL org.opencontainers.image.source="https://github.com/0xERR0R/rest-server" \
org.opencontainers.image.url="https://github.com/0xERR0R/rest-server" \
org.opencontainers.image.title="Rest Server is a high performance HTTP server that implements restic's REST backend API."
ENV DATA_DIRECTORY /data
ENV PASSWORD_FILE /data/.htpasswd