docker-baseimage-kasmvnc
docker-baseimage-kasmvnc copied to clipboard
[BUG] running dind deletes /tmp
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
If I run with --env START_DOCKER="true" and --privileged the /tmp dir is empty. That is causing that for instance in KDE the systemsettings no longer working with the error DBus session bus not found
Expected Behavior
Without running dind (--env START_DOCKER="false") I can found in /tmp for instance the dbus session and KDE systemsettings are working without problems
Steps To Reproduce
- run the container with
--env START_DOCKER="false"and--privileged(tested this with webtop-ubuntu-kde) - check
/tmp - run
sudo /usr/local/bin/dockerd-entrypoint.sh - check
/tmpagain
I digged deeper and the /usr/local/bin/dockerd-entrypoint.sh is running on the end the command /usr/local/bin/dind dockerd --host=unix:///var/run/docker.sock If you run this command will result also in the empty /tmp
I checked the dind command, it is a shell script and in this script you will find
# Mount /tmp (conditionally)
if ! mountpoint -q /tmp; then
mount -t tmpfs none /tmp
fi
When I run mountpoint /tmp after the container was started I get /tmp is not a mountpoint
Thats the reason why the dind script recreates the /tmp
Environment
- OS:
- How docker service was installed:
Docker creation
docker run -d \
--name=webtop \
-e PUID=1000 \
-e PGID=1000 \
-e START_DOCKER="false" \
-p 3000:3000 \
-p 3001:3001 \
--security-opt seccomp=unconfined `#optional` \
--privileged \
--restart unless-stopped \
lscr.io/linuxserver/webtop-ubuntu-kde:latest
Container logs
nothing to see here
Hey, I guess I found a solution?
After creating this issue and thinking through the problem again I searched about tmpfs and /tmp in docker containers and per default (for performance reasons) in a docker container /tmp is a normal directory. But it is possible to change that behavior.
use --tmpfs /tmp in the docker command and /tmp is mounted with tmpfs and this is solving the problem that dind mounts /tmp with tmpfs and overrides the local /tmp
maybe it's a good idea to mention this somewhere in the README.md
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is locked due to inactivity