docker / docker/docker-install
rootless script does not work on $(id -un) that returns backslash
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 3.2k
- Forks
- 863
- Avg merge
- 3h 15m
- Merged PRs (30d)
- 2
Description
- This is a bug report
- This is a feature request
- 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"
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 with the rootless installer invoked by curl -fsSL https://get.docker.com/rootless | sh, focusing on the /etc/subuid check shown in the report and the corresponding subgid detection. Reproduce it with a user whose name contains a backslash and verify that rootless installation completes successfully without breaking the existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100