-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add Docker image publishing to GHCR #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
s0up4200
wants to merge
11
commits into
main
Choose a base branch
from
feat/docker-ghcr-publishing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6d41902
feat: add Docker image publishing to GHCR (#71)
s0up4200 36bc687
fix: correct license in ci.Dockerfile to match project GPL-3.0
s0up4200 99308ea
Update ci.Dockerfile
s0up4200 a595361
Update ci.Dockerfile
s0up4200 beb30dd
cleanup
s0up4200 8d0816f
Merge branch 'main' into feat/docker-ghcr-publishing
s0up4200 db0c10d
Merge branch 'main' into feat/docker-ghcr-publishing
s0up4200 ed3b8fb
cleanup
s0up4200 5a4d40f
ci: enhance build workflow with snapshot builds and version generation
s0up4200 b1515b9
revert: version generation from docker builds
s0up4200 5635345
Merge branch 'main' into feat/docker-ghcr-publishing
KyleSanderson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,50 @@ | ||
| # Documentation | ||
| *.md | ||
| docs/ | ||
|
|
||
| # Git | ||
| .git/ | ||
| .gitignore | ||
| .gitattributes | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Go development | ||
| *.test | ||
| *.out | ||
| coverage.txt | ||
| vendor/ | ||
|
|
||
| # Build artifacts (except the binary we need) | ||
| dist/ | ||
| !dist/*/tqm | ||
|
|
||
| # CI/CD | ||
| .github/ | ||
| .goreleaser.yml | ||
|
|
||
| # Development files | ||
| Makefile | ||
| docker-compose.yml | ||
| .dockerignore | ||
|
|
||
| # Temporary files | ||
| *.tmp | ||
| *.log | ||
| tmp/ | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Node.js (if any) | ||
| node_modules/ | ||
| npm-debug.log | ||
|
|
||
| # Other | ||
| *.orig | ||
| *~ |
This file contains hidden or 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 hidden or 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 hidden or 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,60 @@ | ||||||||
| # build app | ||||||||
| FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.21 AS app-builder | ||||||||
| RUN apk add --no-cache git tzdata | ||||||||
|
s0up4200 marked this conversation as resolved.
Outdated
|
||||||||
|
|
||||||||
| ENV SERVICE=tqm | ||||||||
|
|
||||||||
| WORKDIR /src | ||||||||
|
|
||||||||
| # Cache Go modules | ||||||||
| COPY go.mod go.sum ./ | ||||||||
| RUN go mod download | ||||||||
|
|
||||||||
| COPY . ./ | ||||||||
|
|
||||||||
| ARG VERSION=dev | ||||||||
| ARG REVISION=dev | ||||||||
| ARG BUILDTIME | ||||||||
| ARG TARGETOS | ||||||||
| ARG TARGETARCH | ||||||||
| ARG TARGETVARIANT | ||||||||
|
|
||||||||
| RUN --network=none --mount=target=. \ | ||||||||
| export GOOS=$TARGETOS; \ | ||||||||
| export GOARCH=$TARGETARCH; \ | ||||||||
| [ "$GOARCH" = "amd64" ] && export GOAMD64="$TARGETVARIANT"; \ | ||||||||
| [ "$GOARCH" = "arm64" ] && case "$TARGETVARIANT" in *.*) export GOARM64="$TARGETVARIANT";; esac; \ | ||||||||
| [ "$GOARCH" = "arm64" ] && case "$TARGETVARIANT" in *.*) : ;; v*) export GOARM64="$TARGETVARIANT.0";; esac; \ | ||||||||
| [ "$GOARCH" = "arm" ] && [ "$TARGETVARIANT" = "v6" ] && export GOARM=6; \ | ||||||||
| [ "$GOARCH" = "arm" ] && [ "$TARGETVARIANT" = "v7" ] && export GOARM=7; \ | ||||||||
| echo $GOARCH $GOOS $GOARM$GOAMD64$GOARM64; \ | ||||||||
| go build -ldflags "-s -w -X github.com/autobrr/tqm/pkg/runtime.Version=${VERSION} -X github.com/autobrr/tqm/pkg/runtime.GitCommit=${REVISION} -X github.com/autobrr/tqm/pkg/runtime.Timestamp=${BUILDTIME}" -o /out/bin/tqm cmd/tqm/main.go | ||||||||
|
|
||||||||
| # build runner | ||||||||
| FROM alpine:latest AS runner | ||||||||
|
|
||||||||
| LABEL org.opencontainers.image.source="https://github.com/autobrr/tqm" | ||||||||
| LABEL org.opencontainers.image.licenses="GPL-3.0" | ||||||||
| LABEL org.opencontainers.image.base.name="alpine:latest" | ||||||||
|
|
||||||||
| ENV CONFIG_DIR="/config" \ | ||||||||
| PUID=1000 \ | ||||||||
| PGID=1000 | ||||||||
|
|
||||||||
| RUN apk --no-cache add ca-certificates curl tzdata jq && \ | ||||||||
| addgroup -g $PGID abc && \ | ||||||||
| adduser -D -u $PUID -G abc abc | ||||||||
|
|
||||||||
| WORKDIR /app | ||||||||
| VOLUME /config | ||||||||
| EXPOSE 7337 | ||||||||
|
|
||||||||
| COPY --link --from=app-builder /out/bin/tqm /usr/local/bin/ | ||||||||
|
|
||||||||
| # Health check | ||||||||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | ||||||||
| CMD /usr/local/bin/tqm --help > /dev/null || exit 1 | ||||||||
|
|
||||||||
| USER abc | ||||||||
|
s0up4200 marked this conversation as resolved.
Outdated
|
||||||||
|
|
||||||||
| ENTRYPOINT ["/usr/local/bin/tqm", "--config-dir", "/config"] | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.