build(docker): add multiarch build for ARM, ARM64 and AMD64 (#378)

* Update Docker workflow

add buildx and qemu to support mulitarch builds
configure arm, arm64 and amd64 builds

* Change yarn timeout

fixes issue with yarn install timing out

* chore: update gitignore

* chore: add gitignore for web dir

* chore(web): upgrade to yarn2

* build: update actions and push docker hub

* build: add yarnrc and network-timeout

* build: unifi workflow

* build: depend on web to build first

* build: store artifacts between jobs

* build: store artifacts between jobs

* build: store artifacts between jobs

* build: store artifacts between jobs

* build: adjust dockerignore

* build: conditional extract metadata

* build: conditional extract metadata

* build: always push docker hub

* build: skip docker hub for now

* build: fix metadata
This commit is contained in:
shapechecker 2022-08-03 13:38:32 -04:00 committed by GitHub
parent 98ae6da6ca
commit 22829b194f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 14564 additions and 9459 deletions

44
Dockerfile.ci Normal file
View file

@ -0,0 +1,44 @@
# build app
FROM golang:1.18-alpine3.16 AS app-builder
ARG VERSION=dev
ARG REVISION=dev
ARG BUILDTIME
RUN apk add --no-cache git make build-base
ENV SERVICE=autobrr
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
#ENV GOOS=linux
#ENV CGO_ENABLED=0
RUN go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o bin/autobrr cmd/autobrr/main.go
RUN go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o bin/autobrrctl cmd/autobrrctl/main.go
# build runner
FROM alpine:latest
LABEL org.opencontainers.image.source = "https://github.com/autobrr/autobrr"
ENV HOME="/config" \
XDG_CONFIG_HOME="/config" \
XDG_DATA_HOME="/config"
RUN apk --no-cache add ca-certificates curl
WORKDIR /app
VOLUME /config
COPY --from=app-builder /src/bin/autobrr /usr/local/bin/
COPY --from=app-builder /src/bin/autobrrctl /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/autobrr", "--config", "/config"]
#CMD ["--config", "/config"]