How to replace file content with sed
ENTRYPOINT [ "/docker-entrypoint.sh"]
ENTRYPOINT npm start
You define multiple entrypoint
, see this:
Only the last ENTRYPOINT instruction in the Dockerfile will have an effect.
This means only npm start
make effect, your docker-entrypoint.sh
even did not run...
In this particular case it is your spacing before the :
.
Try sed -e "s/\"mongo\" : \"\${MONGO}\"/\"mongo\": \"$mongoDB\"/g" -i $config
Probably not applicable here, but you can also match any spacing using regex: sed -e "s/\"mongo\"[ ]*:[ ]*\"\${MONGO}\"/\"mongo\": \"$mongoDB\"/g" -i $config