Skip to content

Add .cache folder to .dockerignore for server, slave and web containers#181

Merged
sbesson merged 3 commits intoome:masterfrom
sbesson:dockerignore_cache
Jun 17, 2021
Merged

Add .cache folder to .dockerignore for server, slave and web containers#181
sbesson merged 3 commits intoome:masterfrom
sbesson:dockerignore_cache

Conversation

@sbesson
Copy link
Copy Markdown
Member

@sbesson sbesson commented Jun 15, 2021

While working on latest-ci and recreating containers via docker-compose up -d, the process creates a temporary copy of the context for each container which filled /tmp.

After investigating it turns out the issue comes from the .cache directories which contain ~10G of data. Adding these folders to .dockerignore was sufficient to prevent the creation of unncessary large temporary archives.

@sbesson sbesson requested a review from joshmoore June 15, 2021 11:48
Copy link
Copy Markdown
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

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

LGTM. Likely, this can be extended further since directories are mounted into the images.

@sbesson
Copy link
Copy Markdown
Member Author

sbesson commented Jun 16, 2021

The GH actions failed with

ERROR: for web  Cannot start service web: OCI runtime create failed: invalid mount {Destination:[/home/omero, Type:bind Source:/var/lib/docker/volumes/ed233318d79d1fec50d559f3ee5d0fa9ab3114281cc43963ffa42539c04e8c22/_data Options:[rbind]}: mount destination [/home/omero, not absolute: unknown

Trying to identify the issue brought me to opencontainers/runc#2928. It looks like some changes have been made to relax the absolute path requirement (opencontainers/runc#3004) but absolute paths will be enforced at some point (opencontainers/runc#3020).

For this PR, an immediate workaround would be to downgrade to an earlier version of Ubuntu and/or docker. In the mid-term, we might need to review all our usages of docker-compose making use of relative paths. Using ${pwd} instead of . might work but this does not necessarily have the same meaning.

@joshmoore
Copy link
Copy Markdown
Member

"Use double quotes rather than single quotes for VOLUME" Wow! Was this a change in docker itself?

@sbesson
Copy link
Copy Markdown
Member Author

sbesson commented Jun 17, 2021

Now green...
For completeness, 6b10811 was motivated by my reading of containerd/containerd#5547 (comment). It looks like a JSON with single quotes is treated as a string by the latest release of containerd.io.

@sbesson
Copy link
Copy Markdown
Member Author

sbesson commented Jun 17, 2021

Merging and tagging as it is validated. https://github.com/search?l=Dockerfile&p=3&q=org%3Aome+%22VOLUME+%5B%22&type=Code seems to indicate this repository was the only place where we used VOLUME with an array of single-quoted values.

@sbesson sbesson merged commit 5a213fd into ome:master Jun 17, 2021
@sbesson sbesson deleted the dockerignore_cache branch June 17, 2021 13:10
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