How do I build an image to manage docker as non-root user?
currently my Dockerfile roughly looks like this:
FROM docker:latest
RUN addgroup -S docker && adduser -S test -G docker
USER test:docker
CMD myapp
myapp
is working normally if I use root
user, but I want to be non-root user in certain scenario.
the document said your user need to be under docker
group, so I create the group and add user into it.
but when I tried to execute docker command it still said permission denied. Some said you need to relogin and some said you need to restart docker daemon, is there any way to those in this container? or is there any workaround can solve this problem?
thanks for the help.