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:

  1. inevitably these commands increase more being done
  2. it makes much easier run containers interactively, can run them docker run mycontainer /bin/bash , execute shell script manually. helpful in debugging

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -