Skip to content

Conversation

@TBG-FR
Copy link

@TBG-FR TBG-FR commented Jan 8, 2026

Hello there ! First of all, congratulations for making that amazing tool 🙌

Summary :
I took the liberty to add a Dockerfile to build a Docker image for resumectl, and updated the README accordingly. I tried to keep it as light as possible, while keeping everything working well (especially PDF generation).

image

Additional idea :
It could be nice to add a simple Github Actions workflow to build an official image with each release, so people can simple use docker commands with ghcr.io/juhnny5/resumectl instead of having to build their own image

Feel free to edit what you want, or suggest me changes 😉

Summary by Sourcery

Add Docker support for building and running resumectl and document Docker usage.

New Features:

  • Introduce a Dockerfile to build a resumectl container image with PDF generation support.
  • Allow running resumectl commands via Docker as an alternative to local installation.

Enhancements:

  • Document Docker-based workflows in the README, including example commands and option breakdown.

Build:

  • Add a Dockerfile and .dockerignore to support building a resumectl Docker image.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 8, 2026

Reviewer's Guide

Adds Docker support for building and running resumectl, including a multi-stage Dockerfile, .dockerignore, and README updates documenting Docker build and usage commands.

File-Level Changes

Change Details Files
Introduce a multi-stage Docker image build for resumectl with a wkhtmltopdf-capable runtime image.
  • Add a Go-based builder stage that installs make, copies the repo, runs go mod tidy, and builds the resumectl binary into bin/
  • Add a lightweight runtime stage based on alpine-wkhtmltopdf to support PDF generation
  • Copy the built resumectl binary into the runtime image and configure ENTRYPOINT and default CMD to show help
Dockerfile
Document Docker build and run workflows in the README.
  • Augment the build section with a docker build command for creating a resumectl image
  • Add a Docker usage section showing generic docker run syntax, concrete examples for init/generate/serve, and explain volume/user/port flags via a collapsible details block
README.md
Introduce Docker ignore configuration (file added but contents not shown in diff).
  • Add a .dockerignore file to control Docker build context and reduce image build size/contents
.dockerignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 3 issues, and left some high level feedback:

  • Consider aligning the Go base image version in the Dockerfile (e.g., golang:1.25-alpine3.23) with the version specified in go.mod so that container builds use the same toolchain as local builds.
  • Running go mod tidy inside the Docker build can unexpectedly modify module files; you might want to rely on the existing go.mod/go.sum and run go mod download instead to keep the image build purely consumptive.
  • The .dockerignore file is currently empty; adding common entries like .git, bin/, examples/, and other non-build artifacts will reduce image build context size and speed up builds.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider aligning the Go base image version in the Dockerfile (e.g., `golang:1.25-alpine3.23`) with the version specified in `go.mod` so that container builds use the same toolchain as local builds.
- Running `go mod tidy` inside the Docker build can unexpectedly modify module files; you might want to rely on the existing `go.mod`/`go.sum` and run `go mod download` instead to keep the image build purely consumptive.
- The `.dockerignore` file is currently empty; adding common entries like `.git`, `bin/`, `examples/`, and other non-build artifacts will reduce image build context size and speed up builds.

## Individual Comments

### Comment 1
<location> `Dockerfile:3` </location>
<code_context>
+
+# Build stage
+FROM golang:1.25-alpine3.23 AS builder
+WORKDIR /app
+
</code_context>

<issue_to_address>
**issue (bug_risk):** The Go base image tag `golang:1.25-alpine3.23` likely does not exist and will break builds.

Please switch to a Go base image tag that actually exists on Docker Hub (for example, `golang:1.22-alpine3.20`, or another published version that matches your requirements) and update it over time as needed.
</issue_to_address>

### Comment 2
<location> `Dockerfile:4-11` </location>
<code_context>
+WORKDIR /app
+
+RUN apk add --no-cache make
+COPY . .
+
+# Build the resumectl binary
</code_context>

<issue_to_address>
**suggestion (performance):** Copying the entire context before dependency resolution hurts build caching and can slow builds.

Copying the full source tree before dependency resolution means any app change invalidates the cache and reruns `go mod tidy` and module downloads. Instead, copy only `go.mod`/`go.sum`, download deps, then copy the rest:

```dockerfile
COPY go.mod go.sum ./
RUN go mod download
COPY . .
```

This keeps dependency caching stable and speeds up incremental builds.

```suggestion
WORKDIR /app

RUN apk add --no-cache make

# Copy go module files and download dependencies to leverage Docker build cache
COPY go.mod go.sum ./
RUN go mod download

# Now copy the rest of the source code
COPY . .

# Build the resumectl binary
RUN go mod tidy
RUN make build
```
</issue_to_address>

### Comment 3
<location> `Dockerfile:10` </location>
<code_context>
+COPY . .
+
+# Build the resumectl binary
+RUN go mod tidy
+RUN make build
+
</code_context>

<issue_to_address>
**suggestion:** `go mod tidy` in the build step may introduce non-reproducible builds by mutating go.mod/go.sum.

Because it mutates `go.mod`/`go.sum` during the image build, this step ties the image to whatever the module graph looks like at build time, which can lead to unexpected diffs and flaky CI when upstream dependencies change. For reproducible images, prefer `go mod download` (e.g. `go mod download all`) here and run `go mod tidy` in dev/CI outside the Docker build.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -0,0 +1,23 @@

# Build stage
FROM golang:1.25-alpine3.23 AS builder
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The Go base image tag golang:1.25-alpine3.23 likely does not exist and will break builds.

Please switch to a Go base image tag that actually exists on Docker Hub (for example, golang:1.22-alpine3.20, or another published version that matches your requirements) and update it over time as needed.

Comment on lines +4 to +11
WORKDIR /app

RUN apk add --no-cache make
COPY . .

# Build the resumectl binary
RUN go mod tidy
RUN make build
Copy link

Choose a reason for hiding this comment

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

suggestion (performance): Copying the entire context before dependency resolution hurts build caching and can slow builds.

Copying the full source tree before dependency resolution means any app change invalidates the cache and reruns go mod tidy and module downloads. Instead, copy only go.mod/go.sum, download deps, then copy the rest:

COPY go.mod go.sum ./
RUN go mod download
COPY . .

This keeps dependency caching stable and speeds up incremental builds.

Suggested change
WORKDIR /app
RUN apk add --no-cache make
COPY . .
# Build the resumectl binary
RUN go mod tidy
RUN make build
WORKDIR /app
RUN apk add --no-cache make
# Copy go module files and download dependencies to leverage Docker build cache
COPY go.mod go.sum ./
RUN go mod download
# Now copy the rest of the source code
COPY . .
# Build the resumectl binary
RUN go mod tidy
RUN make build

COPY . .

# Build the resumectl binary
RUN go mod tidy
Copy link

Choose a reason for hiding this comment

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

suggestion: go mod tidy in the build step may introduce non-reproducible builds by mutating go.mod/go.sum.

Because it mutates go.mod/go.sum during the image build, this step ties the image to whatever the module graph looks like at build time, which can lead to unexpected diffs and flaky CI when upstream dependencies change. For reproducible images, prefer go mod download (e.g. go mod download all) here and run go mod tidy in dev/CI outside the Docker build.

@TBG-FR
Copy link
Author

TBG-FR commented Jan 8, 2026

⚠️ It looks like the generated PDF is broken... As the HTML preview/file looks fine, I guess it comes from using wkhtmltopdf instead of weasyprint, maybe it wasn't the best choice... I'll try to fix that !

make build

# Build resumectl Docker image
docker build -t yourname/resumectl .
Copy link
Owner

Choose a reason for hiding this comment

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

Would it be possible to add a task to the Makefile to have something similar to make build?

@juhnny5 juhnny5 self-assigned this Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants