Skip to content

Dockerfile: install dependencies before copying the repository - #1029

Open
0xMuluh wants to merge 3 commits into
develfrom
docker-deps-cache
Open

0xMuluh wants to merge 3 commits into
develfrom
docker-deps-cache

Conversation

@0xMuluh

@0xMuluh 0xMuluh commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1028. The Dockerfile copied the whole repository before installing the dependencies, so every push reinstalled everything. DESCRIPTION is now copied alone first and the repository after the dependencies, so the dependency layers stay cached until DESCRIPTION changes.

The dependencies are now installed with BiocManager::install() instead of devtools::install(). In the devel image, pak took over 5 hours to resolve them and then chose outdated container binaries, such as miaViz 1.21.1 without plotHeatmap() (details in #1028). install.packages() keeps the highest version across repositories.

If the type=local buildx cache starts being evicted from the 10 GB Actions cache, switching to type=gha would be the next step.

Copying the whole repository first changed the layer on every commit, so
every push to devel reinstalled all dependencies. Copying DESCRIPTION
alone keeps the dependency layers cached until DESCRIPTION changes.
pak took over 5 hours to resolve the dependencies in the devel image and
chose outdated container binaries (#1028). install.packages() keeps the
highest version across repositories.
@0xMuluh

0xMuluh commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Tested on a branch (devel + this PR, image built but not pushed): run 45170120607 passed in 45 min. Dependencies installed in 7 min (pak had taken 5.5 h, see #1028), with current versions (miaViz 1.21.21, miaTime 1.3.6, BiocBook 1.11.7, ggtree 4.3.2), and the book rendered in 32 min, past the plotHeatmap chapter that failed before. The stale container binaries are reported in Bioconductor/bioconductor_docker#147.

This branch has not been deployed

No deployments
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.

biocbook: every push to devel reinstalls all dependencies

1 participant