adduser: The user `root' already exists.
See original GitHub issueIn a fresh installation of docker-ce
on Ubuntu-16.04
, if I try to locally build a binder repository, then I get the following logs (and finally the error):
root@myserver:/mount/SDE/crowdAI/conda# repo2docker . --no-run
Using CondaBuildPack builder
Step 1/28 : FROM buildpack-deps:artful
---> 766d0aa6a29e
Step 2/28 : RUN apt-get update && apt-get install --yes --no-install-recommends locales && apt-get purge && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Using cache
---> b173f69c6e6a
Step 3/28 : RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
---> Using cache
---> 3a5031e18af9
Step 4/28 : ENV LC_ALL en_US.UTF-8
---> Using cache
---> a221ace95304
Step 5/28 : ENV LANG en_US.UTF-8
---> Using cache
---> e0315886a2f4
Step 6/28 : ENV LANGUAGE en_US.UTF-8
---> Using cache
---> 0fc8bee8cc99
Step 7/28 : ENV SHELL /bin/bash
---> Using cache
---> 5fd1340b2573
Step 8/28 : ARG NB_USER
---> Using cache
---> 2b0535a59b11
Step 9/28 : ARG NB_UID
---> Using cache
---> 655d60cd28de
Step 10/28 : ENV USER ${NB_USER}
---> Using cache
---> 1bc2aa837513
Step 11/28 : ENV HOME /home/${NB_USER}
---> Using cache
---> ab2784542f9e
Step 12/28 : RUN adduser --disabled-password --gecos "Default user" --uid ${NB_UID} ${NB_USER}
---> Running in bc1f2314bb1d
adduser: The user `root' already exists.
Removing intermediate container bc1f2314bb1d
The command '/bin/sh -c adduser --disabled-password --gecos "Default user" --uid ${NB_UID} ${NB_USER}' returned a non-zero code: 1
This can be deterministically replicated by :
pip install jupyter-repo2docker
git clone https://github.com/binder-examples/conda
cd conda
repo2docker . --no-run
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
adduser says user exists when the user does not exist
As the subject says, I'm trying to add a new user. When I run the command, it says the user already exists. But...
Read more >"User already exists" error when user doesn't exist on the system
The error is very straightforward. It says the user already exists. Now we 'system admins' proudly look at the password file for the...
Read more >error: useradd: user 'root' already exists #189 - GitHub
When I run "sudo ./docker_build.py", I met this error. Here is the output from the Dockerfile when the adduser commands are run:.
Read more >adduser - the user already exists - LinuxQuestions.org
Hi, I am logged in as Root, and in /etc I try: adduser, but it says that the user already exists. When you...
Read more >Add a user to the system *only if it doesn't exist
Show activity on this post. try this: useradd {user} || echo "User already exists." This saves the check since it fails safely if...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe the first thing to do here is to make
repo2docker
recognise it is being executed asroot
and stop with an error message pointing people to the--user-name
and--user-id
options.I think trying to guess as what users we should be running is pretty hard, better to let the user decide for themselves. For the novice user the advice should probably be “you shouldn’t be doing this, do X instead” and for the advanced user pointing them to the CLI options will let them figure out how to get unstuck.
If it still matters, just hit this issue in the
master
build of repo2docker on Ubuntu 18. Was runningjupyter-repo2docker
as sudo to avoid some permissions hassle with Docker.