Performance Issue with Container Startup Due to docker-uid-gid-setup.sh on Mechanical Hard Drives #861
-
|
Description: After investigating the integrated tasks inside the containers, I found that most of the time is spent on permission assignment tasks, such as:
I am not very familiar with Docker, but I noticed that each container has a root account and its own dedicated user ( I am considering whether it is possible to sacrifice some security to improve startup speed. For example, could I change the users of key containers ( Any insights or suggestions would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
This is a known issue for how containerization and user/group namespaces work, and it's really exacerbated by HDDs. The "optionally run as root" idea is interesting, but there are a few containers that will flat-out refuse to run if it thinks the user is root. But there may be some other options that could help you: The main one is, what user ID is Malcolm running under on your host? In other words, at the command line logged in at the account under which you start Malcolm, if you run If you are running Malcolm under a UID/GID other than
OR
The build might take a long time (probably... an hour-ish? maybe longer if the HDDs are a limiting factor for the build as well) but then after that once you're running with these custom images the startup should be faster because it will look at your UID/GID and see they already match (I think this is the really slow one, and if they match it gets skipped) and should start up faster. The other "solution" for this is for my team to go through the containers and be a little bit more surgical in determining exactly which files need their ownership changed and which ones are ok to leave owned by If I've misunderstood something about the premise here (like, you are actually running as 1000/1000?) then let me know and we can talk through it. |
Beta Was this translation helpful? Give feedback.
-
|
I saw the Dockerfile with the following content: Here, I will now modify |
Beta Was this translation helpful? Give feedback.
-
|
I've logged #867 to look for potential optimizations in this process, as well. |
Beta Was this translation helpful? Give feedback.
This is a known issue for how containerization and user/group namespaces work, and it's really exacerbated by HDDs.
The "optionally run as root" idea is interesting, but there are a few containers that will flat-out refuse to run if it thinks the user is root. But there may be some other options that could help you:
The main one is, what user ID is Malcolm running under on your host? In other words, at the command line logged in at the account under which you start Malcolm, if you run
id -uandid -gwhat is returned? My guess is it's probably not the default one that the Malcolm containers were built with, which is1000and1000, respectively. This is "fine" in that it works, that's what…