After trying to test Dockerfiles with Dockerspec, I finally had an issue I can\'t resolve properly.
The problem is, I think, from Docker itself ; If I understand its pro
if your goal is to run the docker exec
with a specific user inside of the container, you can use the --user
option.
docker exec --user myuser container-name [... your command here]
If you want to run gosu
every time, you can specify that as the command with docker exec
docke exec container-name gosu 1000:1000 [your actual command here]
in my experience, the best way to encapsulate this into something easily re-usable is with a .sh script (or .cmd file in windows).
drop this into a file in your local folder... maybe gs
for example.
#! /bin/sh
docker exec container-name gosu 1000:1000 "$@"
give it execute permissions with chmod +x gs
and then run it with ./gs
from the local folder