linux - Docker RUN groupadd && useradd directives have no effect -
i've built docker nginx 'base' image dockerfile fragment below:
from ubuntu:14.04 maintainer me <me.net> run apt-get update && apt-get install -y supervisor add supervisord.conf /etc/supervisor/conf.d/ run apt-get install -y nginx ..
this image linked database container , data volume. later, wanted add user container run applications user added 'run groupadd -r luqo33 && useradd -r -g luqo33 luqo33' directive dockerfile dockerfile this:
from ubuntu:14.04 maintainer me <me.net> run groupadd -r luqo33 && useradd -r -g luqo33 luqo33 run apt-get update && apt-get install -y supervisor add supervisord.conf /etc/supervisor/conf.d/ run apt-get install -y nginx ..
then rebuit image docker build -rm .
, , run whole stack again docker-compose up
(i have stack configured in docker-compose.yml).
unfortunately, although run groupadd -r luqo33 && useradd -r -g luqo33 luqo33
step did not error out, when entered shell of running nginx container, luqo33
user or luqo33
group not there. executed same commands (groupadd -r luqo33 && useradd -r -g luqo33 luqo33
) shell, , group , user added expected.
why wouldn't run groupadd -r luqo33 && useradd -r -g luqo33 luqo33
in dockerfile add user , group new container upon rebuilding? tried docker build --no-cache .
same effect (or lack of it). missing here?
to make sure build command isn't making use of cached layer, use --no-cache
option.
docker build --no-cache .
if want same docker-compose:
docker-compose build --no-cache
also since using docker-compose start container, make sure run docker-compose rm
or else docker-compose reuse built images.
Comments
Post a Comment