docker-install icon indicating copy to clipboard operation
docker-install copied to clipboard

rootless script does not work on $(id -un) that returns backslash

Open deltabungee opened this issue 4 years ago • 1 comments

  • [x] This is a bug report
  • [ ] This is a feature request
  • [x] I searched existing issues before opening this one

Expected behavior

Following the documentation https://docs.docker.com/engine/security/rootless/ the command below should enable the rootless mode for docker

curl -fsSL https://get.docker.com/rootless | sh

Actual behavior

the script fail on line if ! grep "^$(id -un):\|^$(id -u):" /etc/subuid >/dev/null 2>&1; then

due to the presence of a backslash character in the output of the command "id -un"

Steps to reproduce the behavior

create and use a user with a backslash in his name launch the command line : curl -fsSL https://get.docker.com/rootless | sh

I have try to fix the lines for subuid and subgid detection using sed but it is not sufficient grep "^$(id -un | sed -e "s/[\]/\\\\\\\\/g"):" /etc/subuid

Output of docker version:

(paste your output here)

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.)

aws workspace NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2"

deltabungee avatar Sep 16 '21 09:09 deltabungee

/cc @akihirosuda

thaJeztah avatar Sep 29 '21 15:09 thaJeztah