Open rt7055 opened 5 years ago
~/.bash_profile
may work for you.
Also, you don't need to grep/awk for the uid. id -u
should work.
Here's what I've done and wanting a solution:
curl -fsSL https://get.docker.com/rootless | sh
/etc/systemd/system/docker-rootless.service
as 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`
systemctl daemon-reload
systemctl enable docker-rootless.service
which created the symlink.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.
Hi,
I would like to automate these steps to install docker as the rootless user for that I've created shell script.but while doing echo "export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock" using shell script it is not working.on manual, it is working fine.
Even though if I export this value to ~/.bashrc, it is not showing in system environment. Could you please let me know how I can automatically add this value as env on the ubuntu machine. Thanks Rohit Thakur.