I stumbled upon this issue this morning: Improve discoverability of available images · Issue #185 · hexpm/bob · GitHub
Every time I decide to bump image versions it gets frustrating to discover what is the lastest Elixir + OTP + base image that is a valid tag.
This is a pain I also felt a few months ago, so I came up with a Renovate configuration that keeps hexpm/elixir
up-to-date in my Dockerfile.
After finding the mentioned GitHub issue, I found it might interest some of you, so I’ve setup a minimal reproduction repository to showcase that
cc @rhcarvalho
Benefits of this config
Automatically updates the hexpm/elixir
Docker base image tag (for Fly)
Keeps Elixir/OTP versions in sync between asdf
(.tool-versions
) and
production Docker
How does it work
We use version comments in [Dockerfile` to tell Renovate
where to find the version information for each part of the image (Debian,
OTP & Elixir)
We setup a “Test Docker Build” CI workflow that makes sure the image tag
composed from those three versions actually exist (so Renovate doesn’t
auto-merge an inexistant image, if auto-merge is enabled in the first place)
We add the regexManagers:dockerfileVersions
preset and a few package rules
for the Debian versioning
When merging update PRs for each component, I find it’s best to merge them in
this order: Debian > OTP > Elixir.
3 Likes
D4no0
June 12, 2024, 7:03pm
2
This is pretty neat, this was always a pain in the ass to configure, especially when dockerhub elixir images didn’t use to have the OTP version specified.
2 Likes
On a side note, Renovate has been broken for Elixir dependencies since 1.17 was released, but this is about to get fixed!
containerbase:main
← sheerlox:feat/support-elixir-1.17.0
opened 05:45PM - 12 Jun 24 UTC
Elixir v1.17.0 just released. The install script is failing because the OTP vers… ion if/else block isn't up-to-date.
Renovate is effectively broken for Elixir right now: https://github.com/sheerlox/elixir_renovate_demo/pull/6
Renovate log from the PR above (Mend Renovate job id `7e88e954-625d-4a07-804b-45eefc1a151c`):
```
[17:27:45.046] INFO (193): Installing tool elixir@1.17.0...
installing v2 tool elixir v1.17.0
Download failed: https://github.com/elixir-lang/elixir/releases/download/v1.17.0/elixir-otp-24.zip
[17:27:45.616] INFO (221): Downloading file ...
url: "https://github.com/elixir-lang/elixir/releases/download/v1.17.0/elixir-otp-24.zip"
output: "/tmp/renovate/cache/containerbase/f7649696d9e36012fd17fe14a3344673897f8c089328bc8a15abaf579e0f5ab1/elixir-otp-24.zip"
[17:27:45.764] FATAL (221): Response code 404 (Not Found)
err: {
"type": "HTTPError",
"message": "Response code 404 (Not Found)",
// ...
}
[17:27:45.890] INFO (221): Download completed with errors in 281ms.
[17:27:45.901] FATAL (193): Command failed with exit code 1: /usr/local/containerbase/bin/install-tool.sh elixir 1.17.0
err: {
"type": "Error",
"message": "Command failed with exit code 1: /usr/local/containerbase/bin/install-tool.sh elixir 1.17.0",
"stack":
Error: Command failed with exit code 1: /usr/local/containerbase/bin/install-tool.sh elixir 1.17.0
at makeError (/snapshot/dist/containerbase-cli.js:39455:13)
at handlePromise (/snapshot/dist/containerbase-cli.js:40170:29)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InstallLegacyToolService.execute (/snapshot/dist/containerbase-cli.js:56573:5)
at async InstallToolService.execute (/snapshot/dist/containerbase-cli.js:56765:9)
at async InstallToolShortCommand.execute (/snapshot/dist/containerbase-cli.js:57006:14)
at async InstallToolShortCommand.validateAndExecute (/snapshot/dist/containerbase-cli.js:2428:26)
at async _Cli.run (/snapshot/dist/containerbase-cli.js:3541:22)
at async _Cli.runExit (/snapshot/dist/containerbase-cli.js:3549:28)
at async main (/snapshot/dist/containerbase-cli.js:57200:3)
"shortMessage": "Command failed with exit code 1: /usr/local/containerbase/bin/install-tool.sh elixir 1.17.0",
"command": "/usr/local/containerbase/bin/install-tool.sh elixir 1.17.0",
"escapedCommand": "\\"/usr/local/containerbase/bin/install-tool.sh\\" elixir 1.17.0",
"exitCode": 1,
"cwd": "/tmp/renovate/repos/github/sheerlox/elixir_renovate_demo",
"failed": true,
"timedOut": false,
"isCanceled": false,
"killed": false
}
[17:27:46.150] INFO (193): Installed tool elixir with errors in 1.1s.
```