How to create username and password for containers OR how to set password inside the container

3/12/2019

As container can be accessed by everyone by inserting command docker ps -a (running containers), so need to protect the containers. I want to create user credentials to access the container. Each user should have login details. Please help me out with this issue.

-- amit potdar
containers
docker
kubernetes
open-policy-agent

1 Answer

3/12/2019

You need to do this at a level above docker. The most you can do with just the CE engine is configure open policy agent, but I don't think it has the granularity or usability you want. Tools that run on top of docker, like UCP, provide this sort of functionality.

From the low level engine standpoint, this request doesn't make much sense since docker is a sysadmin level tool giving every user with access to the API root access on the host, which gives every docker user access to everything.

-- BMitch
Source: StackOverflow