Monday, 15 July 2013

How to run my golang webapp in docker based on scratch as the user nobody? -



How to run my golang webapp in docker based on scratch as the user nobody? -

i don't want run in docker container root. , want minimalistic images.

i can run compiled golang app in scratch-image without problem. when don't want run root (i assume running root) , define user nobody in dockerfile get

014/10/25 06:07:10 error response daemon: cannot start container 4822f34e54e20bb580f8cd1d38d7be3c828f28595c2bebad6d827a17b4c2fe21: finalize namespace setup user supplementary groups unable find user nobody

here dockerfile

from scratch add together lichtpunkt_go_linux_amd64 /lichtpunkt_go_linux_amd64 add together web /web user nobody cmd ["./lichtpunkt_go_linux_amd64"] expose 3001

edit ------------

turns out scratch empty, empty.

run useradd execute /bin/sh -c useradd there no /bin/sh . run ["useradd"] exec directly. there no useradd. d have add together rootfs.tar , build stuff zero.

i ll utilize debian don't wont run root within container because ...

treat root within container if root outside of container

you still have add together user before can utilize user command.

from scratch add together lichtpunkt_go_linux_amd64 /lichtpunkt_go_linux_amd64 add together web /web run useradd nobody user nobody cmd ["./lichtpunkt_go_linux_amd64"] expose 3001

docker

No comments:

Post a Comment