Open
Description
I am trying to run a conitner with a non root user but i am not able.
I use the following dockerfile
FROM minidocks/lftp
RUN apk update
RUN apk add --update sudo
# Add user karate
RUN adduser -u 47001 -D karate
RUN echo "karate ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
RUN chmod 0440 /etc/sudoers
USER karate
CMD ["ash"]
This will set the default user for the container to be the "karate" user, and start the container with the "ash" shell as the default command. One can run the container with:
docker build -t <image_name:1.0> .
docker run -it --rm <image_name:1.0>
But I get nothing in response and the contianer does not get created
If I use the user karate in docker run
I also get the same.
docker run -it --rm --user karate <image_name:1.0>
What would be the proper way to add the non root user?
Metadata
Metadata
Assignees
Labels
No labels