Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Docker cache mounts for Apt lists #57

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

EzraBrooks
Copy link
Member

I've added

--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \

in front of every operation that modifies the Apt lists. This ensures that the Apt lists will not end up in the layers and in the final image, while preserving the lists between operations so it doesn't slow down the build.

@mkhansenbot
Copy link
Contributor

Thanks for doing this. However, I rebased my branch onto this one and tested it and the build is still taking too much disk space.
https://github.com/space-ros/docker/actions/runs/5658295848

@EzraBrooks
Copy link
Member Author

Very odd. we can probably try using the disk space workaround in upstream moveit2. but I don't find I need that on MoveIt Studio, which itself source-builds moveit2..

@mkhansenbot
Copy link
Contributor

Do we still want this PR?

@EzraBrooks
Copy link
Member Author

I think so, but not urgently

@mkhansenbot
Copy link
Contributor

Can you rebase the branch onto main and then we can see it pass the build?

@EzraBrooks EzraBrooks force-pushed the use-docker-cache-mounts-for-apt-lists branch from 8418eb2 to 2131431 Compare August 10, 2023 15:08
@mkhansenbot mkhansenbot force-pushed the use-docker-cache-mounts-for-apt-lists branch from 2131431 to 129992a Compare August 26, 2023 16:15
@EzraBrooks
Copy link
Member Author

List directory /var/lib/apt/lists/partial is missing. - Acquire (2: No such file or directory)

haven't seen this one before even though I use this strategy in all my projects.. will poke at it

@EzraBrooks EzraBrooks marked this pull request as draft August 28, 2023 13:52
@EzraBrooks EzraBrooks force-pushed the use-docker-cache-mounts-for-apt-lists branch 2 times, most recently from 2217103 to 11d4ef6 Compare August 28, 2023 13:55
@EzraBrooks EzraBrooks linked an issue Aug 28, 2023 that may be closed by this pull request
@Bckempa Bckempa added this to the humble-2024.01.0 milestone Dec 3, 2023
@EzraBrooks
Copy link
Member Author

Revisiting this, it seems like CI passes. This is actually probably ready for review!

@EzraBrooks EzraBrooks marked this pull request as ready for review December 14, 2023 18:20
@EzraBrooks
Copy link
Member Author

Add a comment to first occurrence in each Dockerfile explaining why this is good, also add a doc in a README (in main docs repo?)

@EzraBrooks EzraBrooks force-pushed the use-docker-cache-mounts-for-apt-lists branch 2 times, most recently from aa878c6 to 922fb0a Compare December 28, 2023 21:50
@Bckempa Bckempa force-pushed the use-docker-cache-mounts-for-apt-lists branch from 922fb0a to b307544 Compare January 16, 2024 00:31
Copy link
Contributor

@Bckempa Bckempa left a comment

Choose a reason for hiding this comment

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

This is all fine, we really need to review all these Dockerfiles for a few reasons but that's well out of scope.

@EzraBrooks EzraBrooks merged commit 9a8ad87 into main Jan 17, 2024
3 checks passed
@Bckempa Bckempa deleted the use-docker-cache-mounts-for-apt-lists branch January 17, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Docker containers should share an Apt cache during build
3 participants