Root user on docker image in CircleCI 2.0

build-image
docker
circle.yml

#1

I’m using a pre-built docker image and when it starts it uses root user by default. There are no other available users (like circleci user in VM) to use instead of root. Is there any way a new user can be added and used for commands inside the docker image?


#2

Possibly, but it depends on the specific Docker image and the OS it’s using. Users within the image can be created just like users would be created on the normal OS. For example, in Ubuntu (and other Debian-based distros), you can use adduser or for more fine-grained control, useradd.


#3