Skip to content

feat: add Docker image publishing to GHCR - #72

Open
s0up4200 wants to merge 11 commits into
mainfrom
feat/docker-ghcr-publishing
Open

feat: add Docker image publishing to GHCR#72
s0up4200 wants to merge 11 commits into
mainfrom
feat/docker-ghcr-publishing

Conversation

@s0up4200

Copy link
Copy Markdown
Contributor

No description provided.

@s0up4200 s0up4200 changed the title feat: add Docker image publishing to GHCR (#71) feat: add Docker image publishing to GHCR Jul 21, 2025
@s0up4200 s0up4200 added enhancement New feature or request build labels Jul 21, 2025
@s0up4200

Copy link
Copy Markdown
Contributor Author

#71

@s0up4200 s0up4200 linked an issue Jul 21, 2025 that may be closed by this pull request
Comment thread ci.Dockerfile Outdated
Comment thread ci.Dockerfile Outdated
Comment thread ci.Dockerfile Outdated
s0up4200 and others added 3 commits July 22, 2025 17:54
Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
@s0up4200
s0up4200 marked this pull request as ready for review July 22, 2025 19:37
@s0up4200 s0up4200 moved this to In review in TQM development Jul 22, 2025
@s0up4200
s0up4200 requested a review from nuxencs July 25, 2025 15:27

@nuxencs nuxencs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't we use goreleaser-pro here or is it only enabled in autobrr/autobrr? 🤔
we should probably also use --snapshot for Run GoReleaser build and --parallelism 5 for Run GoReleaser build and publish tags.

- name: Run GoReleaser build
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --skip=validate,publish --parallelism 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser build and publish tags
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

last thing: it would be nice to have it actually return a version other than main in the built image, example here from my seasonpackarr 😅
that would result in 1.15.0-dev8 for example
https://github.com/nuxencs/seasonpackarr/blob/16291f2b3ad4f88e05535acdf11465d8141390ef/.github/workflows/release.yml#L140-L178

- Add --snapshot flag to PR builds for proper snapshot releases
- Add --parallelism 5 to tag releases for faster builds
- Implement dynamic version generation for main branch builds (e.g., v1.15.0-dev8)
- Update Docker metadata to use generated versions for development builds
@s0up4200

Copy link
Copy Markdown
Contributor Author

Talked to Nuxen on Discord, re goreleaser-pro. Its available org wide, but no benefit from using as long as we dont use the pro features.

@s0up4200

Copy link
Copy Markdown
Contributor Author

This does not run in its current state, and needs more work. Will continue on it in the coming days.

Comment thread ci.Dockerfile
Comment on lines +44 to +52
RUN mkdir -p /config && \
chown nobody:nogroup /config

WORKDIR /app
VOLUME /config

COPY --link --from=app-builder /out/bin/tqm /usr/local/bin/

USER nobody:nogroup

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN mkdir -p /config && \
chown nobody:nogroup /config
WORKDIR /app
VOLUME /config
COPY --link --from=app-builder /out/bin/tqm /usr/local/bin/
USER nobody:nogroup
COPY --link --from=app-builder /out/bin/tqm /usr/local/bin/
USER nobody:nogroup
WORKDIR /config
VOLUME ["/config"]

This is how I've been building containers over at https://github.com/home-operations/containers

Comment thread ci.Dockerfile

USER nobody:nogroup

ENTRYPOINT ["/usr/local/bin/tqm", "--config-dir", "/config"] No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ENTRYPOINT ["/usr/local/bin/tqm", "--config-dir", "/config"]
ENTRYPOINT ["/usr/local/bin/tqm", "--config-dir", "/config"]

@onedr0p

onedr0p commented Aug 13, 2025

Copy link
Copy Markdown

@s0up4200 was there something else we are missing here? With my suggested changes, PR looks good from here.

@saltydk

saltydk commented Aug 13, 2025 via email

Copy link
Copy Markdown
Collaborator

@onedr0p

onedr0p commented Aug 13, 2025

Copy link
Copy Markdown

@saltydk maybe I'm missing some context but what does that have to do with publishing a container image?

@saltydk

saltydk commented Aug 13, 2025 via email

Copy link
Copy Markdown
Collaborator

@onedr0p

onedr0p commented Aug 13, 2025

Copy link
Copy Markdown

I'm running tqm in a custom built image just fine. I still feel like I'm missing context here, there's no open issues or PRs about the issue you just brought up.

@saltydk

saltydk commented Aug 13, 2025 via email

Copy link
Copy Markdown
Collaborator

@onedr0p

onedr0p commented Aug 14, 2025

Copy link
Copy Markdown

I do remember skimming that but thought the issue was sometime else. Thanks for walking me though it.

For the future travelers, the issue is tqm expects the config to be in the user directory and tries to create the path.

ucd, err := os.UserConfigDir()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Build and publish Docker image to GHCR

5 participants