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

[BUG] running dind deletes /tmp #78

Open
1 task done
hgw77 opened this issue Aug 1, 2024 · 2 comments
Open
1 task done

[BUG] running dind deletes /tmp #78

hgw77 opened this issue Aug 1, 2024 · 2 comments

Comments

@hgw77
Copy link

hgw77 commented Aug 1, 2024

Is there an existing issue for this?

  • 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

  1. run the container with --env START_DOCKER="false" and --privileged (tested this with webtop-ubuntu-kde)
  2. check /tmp
  3. run sudo /usr/local/bin/dockerd-entrypoint.sh
  4. check /tmp again

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
@hgw77
Copy link
Author

hgw77 commented Aug 1, 2024

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

@LinuxServer-CI
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Issues
Development

No branches or pull requests

2 participants