-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add distroless docker builds (#84)
* feat: add distroless docker builds * disable unsupported distroless platforms * add missing digest upload * Revert "add missing digest upload" This reverts commit fb17fb8. * add digests * Revert "add digests" This reverts commit 63fb950. * add digests again * speculative fix * speculating * weebs * weeeeeebs * need to ask kyle * another attempt * speculatarr * update readme and compose * Revert "fix(dockerfile): remove unnecessary spaces" This reverts commit 50520b7, reversing changes made to d3af84b. * fix: bring in kyles changes * fix: cleanup bad merge * fix(dockerfile): remove unnecessary spaces
- Loading branch information
Showing
4 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# build app | ||
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 AS app-builder | ||
#RUN apk add --no-cache git tzdata | ||
|
||
ENV SERVICE=omegabrr | ||
|
||
WORKDIR /src | ||
|
||
# Cache Go modules | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . ./ | ||
|
||
ARG VERSION=main | ||
ARG REVISION=main | ||
ARG BUILDTIME | ||
ARG TARGETOS TARGETARCH TARGETVARIANT | ||
|
||
RUN --network=none --mount=target=. \ | ||
export GOOS=$TARGETOS; \ | ||
export GOARCH=$TARGETARCH; \ | ||
echo $GOARCH $GOOS; \ | ||
go build -ldflags "-s -w -X github.com/autobrr/omegabrr/internal/buildinfo.Version=${VERSION} -X github.com/autobrr/omegabrr/internal/buildinfo.Commit=${REVISION} -X github.com/autobrr/omegabrr/internal/buildinfo.Date=${BUILDTIME}" -o /out/bin/omegabrr cmd/omegabrr/main.go | ||
|
||
# build runner | ||
FROM gcr.io/distroless/static-debian12:nonroot | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/autobrr/omegabrr" | ||
LABEL org.opencontainers.image.licenses="MIT" | ||
LABEL org.opencontainers.image.base.name="gcr.io/distroless/static-debian12:nonroot" | ||
|
||
COPY --from=app-builder /out/bin/omegabrr /usr/local/bin/ | ||
|
||
WORKDIR /config | ||
|
||
EXPOSE 7441 | ||
|
||
ENTRYPOINT ["omegabrr", "run", "--config", "/config/config.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters