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

Can't use docker daemon after using start-docker.sh #32

Open
DavidJakszta opened this issue Aug 24, 2024 · 4 comments
Open

Can't use docker daemon after using start-docker.sh #32

DavidJakszta opened this issue Aug 24, 2024 · 4 comments

Comments

@DavidJakszta
Copy link

DavidJakszta commented Aug 24, 2024

Bug description

I get this error when starting docker in this image. I use Docker Desktop on WSL2.

root@a48aec4bfb16:/# docker ps

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`

Complete Logs: `root@a48aec4bfb16:/# start-docker.sh

[Sat Aug 24 12:42:22 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Starting supervisor

[Sat Aug 24 12:42:22 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waiting for docker to be running

[Sat Aug 24 12:42:22 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Process dockerd is not running yet. Retrying in 1 seconds

[Sat Aug 24 12:42:22 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waited 0 seconds of 30 seconds

[Sat Aug 24 12:42:23 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Process dockerd is not running yet. Retrying in 1 seconds

[Sat Aug 24 12:42:23 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waited 1 seconds of 30 seconds

[Sat Aug 24 12:42:24 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] dockerd is running

root@a48aec4bfb16:/# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Reproducable steps:

docker run -it --entrypoint /bin/bash cruizba/ubuntu-dind:latest

in bash
start-docker.sh
docker ps

Is this a bug or am i missing something?

@cruizba
Copy link
Owner

cruizba commented Aug 29, 2024

You need to run it using the --privileged flag (which is insecure) or install sysbox and use the --runtime=sysbox-runc

@Roedy13
Copy link

Roedy13 commented Sep 27, 2024

I've tried both of those options or none of them, and I always get

[Fri Sep 27 15:45:06 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Starting supervisor
[Fri Sep 27 15:45:06 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waiting for docker to be running
pgrep: uptime
[Fri Sep 27 15:45:06 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Process dockerd is not running yet. Retrying in 1 seconds
[Fri Sep 27 15:45:06 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waited 0 seconds of 30 seconds
[Fri Sep 27 15:45:07 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Process dockerd is not running yet. Retrying in 1 seconds
[Fri Sep 27 15:45:07 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waited 1 seconds of 30 seconds
<etc etc>
[Fri Sep 27 15:45:36 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Process dockerd is not running yet. Retrying in 1 seconds
[Fri Sep 27 15:45:36 UTC 2024] [INFO] [/usr/local/bin/start-docker.sh] Waited 29 seconds of 30 seconds
[Fri Sep 27 15:45:37 UTC 2024] [ERROR]  dockerd is not running after max time

After starting the container I can still attempt to run docker run hello-world and they all work

docker run -it -v /var/run/docker.sock:/var/run/docker.sock cruizba/ubuntu-dind:jammy-27.3.0 /bin/bash
docker run -it -v /var/run/docker.sock:/var/run/docker.sock --privileged cruizba/ubuntu-dind:jammy-27.3.0 /bin/bash
docker run -it -v /var/run/docker.sock:/var/run/docker.sock --runtime=sysbox-runc cruizba/ubuntu-dind:jammy-27.3.0 /bin/bash

@cruizba
Copy link
Owner

cruizba commented Sep 30, 2024

@Roedy13 Can you show me the entire command you are using when it fails and your Docker Desktop version?

@Roedy13
Copy link

Roedy13 commented Sep 30, 2024

I'm on Debian 12, so sysbox is not compatible. That's probably part of my problem, I would still expect the --privileged option to work.

$ docker --version
Docker version 20.10.24+dfsg1, build 297e128

These are the entire commands. I'll ignore the sysbox for now

docker run -it -v /var/run/docker.sock:/var/run/docker.sock cruizba/ubuntu-dind:jammy-27.3.0 /bin/bash
docker run -it -v /var/run/docker.sock:/var/run/docker.sock --privileged cruizba/ubuntu-dind:jammy-27.3.0 /bin/bash

This is by no means critical for me. I'm using this in a gitlab CI runner and it seems to run fine in the runner with an ubuntu host system.

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

No branches or pull requests

3 participants