dockerfile - docker: npm install on docker start -
i'd have kind of "development docker image" in npm install
executed every time restart docker container (becuase don't want build, push , pull new dev image every day local machine our docker server). thought sth. in dockerfile:
cmd npm install git+ssh://git@mycompany.de/my/project.git#develop && npm start
sadly, doesn't work. container stops after docker start
, don't know why, because works:
run npm install git+ssh://git@mycompany.de/my/project.git#develop cmd npm start
(just testing, that's of course not want have). maybe have wrong perception of cmd
, enlighten me?
make cmd
point shell script.
cmd ["/my/path/to/entrypoint.sh"]
with script being:
#!/bin/bash npm install git+ssh://git@mycompany.de/my/project.git#develop npm start # whatever else
i find easier few reasons:
- inevitably these commands increase more being done
- it makes much easier run containers interactively, can run them
docker run mycontainer /bin/bash
, execute shell script manually. helpful in debugging
Comments
Post a Comment