Skip to content

Dockerfile improvements#514

Merged
bachp merged 3 commits into
bachp:masterfrom
pstoeckle:master
Jun 1, 2026
Merged

Dockerfile improvements#514
bachp merged 3 commits into
bachp:masterfrom
pstoeckle:master

Conversation

@pstoeckle
Copy link
Copy Markdown
Contributor

  • Update from bookworm to trixie
  • Pin container images via digest
  • set -eux ; to avoid && chaining and improve
  • -qq to avoid clutter
  • .dockerignore to reduce container build context
  • build cache for cargo dependencies

@bachp
Copy link
Copy Markdown
Owner

bachp commented May 26, 2026

Thanks for the PR. Changes look good. But can you explain to me (or point me to some documentation) how the caching with with bind mount works. I am not familiar with it.

@pstoeckle
Copy link
Copy Markdown
Contributor Author

Thanks for the PR. Changes look good. But can you explain to me (or point me to some documentation) how the caching with with bind mount works. I am not familiar with it.

See the Docker documentation for cache mounts https://docs.docker.com/build/cache/optimize/#use-cache-mounts

There is also a simple example for rust. I added first a RUN command with the rust files and the cache mounted into the container ➡️ only the dependencies are downloaded, and stored in the cache mount. Afterward, all files that are NOT excluded by the .dockerignore are copied into the running container. Since we mount the cache mount again into the container, the cargo install only compiles the stuff, but does not download it again.

@pstoeckle
Copy link
Copy Markdown
Contributor Author

Is there anything missing for this PR? I cannot fix the pipeline, since the failing job is the push container image one...

@bachp
Copy link
Copy Markdown
Owner

bachp commented Jun 1, 2026

@pstoeckle No there is no issue with this PR. I just wanted to fix the container deployment issue first before merging this. But I can also do this afterwards.

@bachp bachp merged commit 418e0d5 into bachp:master Jun 1, 2026
12 of 14 checks passed
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