docker / docker/docker-install
Rootless docker, auto start problem.
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 3.2k
- Forks
- 863
- Avg merge
- 3h 15m
- Merged PRs (30d)
- 2
Description
Problem:
Cannot connect to the Docker daemon at unix:///run/user/1000/docker.sock. Is the docker daemon running?
Here's what I've done and wanting a solution:
- Created a user 'docker' on my CentOS 7.9.
- Ran the
curl -fsSL https://get.docker.com/rootless | sh - Created
/etc/systemd/system/docker-rootless.serviceas root with below contents:
`[Unit]
Description=Docker Rootless Startup
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/su -c /home/docker/bin/dockerd-rootless.sh - docker
TimeoutStartSec=0
[Install]
WantedBy=default.target`
- Ran
systemctl daemon-reload - Last but not least,
systemctl enable docker-rootless.servicewhich created the symlink. - Reboot.
However, the dockerd-rootless.sh runs, gets a PID but when running docker ps it returns:
Cannot connect to the Docker daemon at unix:///docker.sock. Is the docker daemon running?
I've tried adding:
export DOCKER_HOST=unix:///run/user/1001/docker.sock
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
to the .bashrc of the docker user.
Any help would be greatly appreciated.
Cheers.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing /etc/systemd/system/docker-rootless.service and the docker user's .bashrc, then reproduce the reboot and run the reported docker ps command. Check whether dockerd-rootless.sh is using the same runtime socket and environment as the client; done means the rootless daemon starts automatically and docker ps connects successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100