I am trying to run a docker as a rootless mode in ubuntu VM.
sudo apt-get install -y uidmap
curl -fsSL https://get.docker.com/rootless | sh
export DOCKER_HOST=unix:///run/user/1000/docker.sock
systemctl --user status docker
should any could help to solve this issue or is there any other workaround for this.
Thanks in Advance.
I have tried with switch user and execute but still, these commands are not executing.
sudo apt-get install -y uidmap
curl -fsSL https://get.docker.com/rootless | sh
export DOCKER_HOST=unix:///run/user/1000/docker.sock
systemctl --user status docker
I would like to automate this using a terraform run module or any other way but the only thing is this should be executed once VM is provision.
Read the script https://get.docker.com/rootless where it says "This script should be run with an unprivileged user and install/setup Docker under $HOME/bin/"
If you do still want to install it then you just need to learn how to read shell scripts as there is this part in the script:
# User verification: deny running as root (unless forced?)
if [ "$(id -u)" = "0" ] && [ -z "$FORCE_ROOTLESS_INSTALL" ]; then
>&2 echo "Refusing to install rootless Docker as the root user"; exit 1
fi
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.