8000 Is it possible to add a non root user ? · Issue #2 · minidocks/lftp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Is it possible to add a non root user ? #2
Open
@iliion

Description

@iliion

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0