How can I set the user the docker image is running under?

I start some dockered elastic nodes as described in https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html

On the host in "top" output I see some java processes running under user id 1000.
Can I change it somehow to a particular user id?

Got resolved it by myself.

It runs under user id 1000 because of this piece under the manifest/history:

"container_config": {
        "Cmd": [
            "/bin/sh -c adduser -D -u 1000 -h /usr/share/elasticsearch elasticsearch"
        ]
    }

So the user it will use to run the server process under is created as id=1000.

I resolved it with the userns-remap feature via /etc/docker/daemon.json

{
    "userns-remap": "default"
}

(I don't care which user is gonna be used for remapping that's why default.)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.