Skip to content

build: Use PlantUML from Docker image to work with Renovate, remove pip cache - #92

Open
GabDug wants to merge 3 commits into
backstage:mainfrom
Believe-SA:plantuml-from-official-image
Open

build: Use PlantUML from Docker image to work with Renovate, remove pip cache#92
GabDug wants to merge 3 commits into
backstage:mainfrom
Believe-SA:plantuml-from-official-image

Conversation

@GabDug

@GabDug GabDug commented Aug 12, 2026

Copy link
Copy Markdown
Member

Hey there, here's a few backports from our internal techdocs image setup, which should help with maintenance:

  • Get the PlantUML jar from Docker instead of Github releases
    • Same file, but works with Renovate out of the box while keeping the SHA pinning (via the image digest).
  • Remove ~30MB pip cache from the image
  • Merge the RUN chmod 755 to have one less layer
  • Enable github-actions via Renovate (noticed actions/checkout@v2 had no pin)

I've kept curl in the image to avoid breaking consumers workflows (e.g. if image is used in a CI to curl something?). Tested locally and seems fine :)

As a follow-up, I may also backport our uv setup, to have a lockfile and thus more reproducible builds if you're interested.

Cheers!

GabDug and others added 3 commits August 12, 2026 11:46
The jar was curl'd from a GitHub release and validated against a sha1sum
that had to be regenerated by hand on every bump, so Renovate could not
touch it. plantuml/plantuml packages the same release, and a tag + digest
pin on COPY --from is something Renovate updates like any other image.

Also replaces the `echo $'...'` wrapper with printf. $'' is a bashism: it
happens to work under busybox ash here, but a shell without it writes a
literal `$` into the shebang, which is the Exec format error the comment
above the RUN warns about for the Backstage Backend container. printf
behaves the same everywhere, so the warning keeps its point but no longer
needs a second RUN variant to copy. `>` instead of `>>` also stops a
layer rebuild from concatenating two scripts into the file.

Verified with a local build for the pinned digest (multi-arch index, so
the linux/arm64 leg still resolves): `plantuml -version` reports
1.2026.2, and `mkdocs build` on mock-docs renders the diagram.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
pip install wrote 31.5 MB of wheels and cached response bodies to
/root/.cache/pip, which the layer then kept forever. Nothing in the
container reads it: the install runs once at build time.

Image goes from 737 MB to 705 MB. A ~1 MB http-v2 remainder survives
--no-cache-dir, so it is not worth an extra rm.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
config:best-practices already extends helpers:pinGitHubActionDigests, but
enabledManagers left out github-actions, so that half of the preset was
dead config and no workflow pin has moved since it was written.

The workflows are 1-3 majors behind as a result, including
actions/checkout@v2 and actions/stale@v4.1.1.

Expect the first run to open a batch of PRs: major bumps plus SHA pins
for every action, per the preset already in use.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
@GabDug
GabDug force-pushed the plantuml-from-official-image branch from 41c7041 to 18f6c78 Compare August 12, 2026 09:47
@GabDug
GabDug marked this pull request as ready for review August 12, 2026 13:55
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.

1 participant