linux - How can i execute commands inside containers during host provision -


i using vagrant build docker host , have shell script install required packages host , script build , run containers

vagrant file

config.vm.provision :shell, :inline => "sudo /vagrant/bootstrap.sh" 

inside run containers like

docker run -d  . .bla bla .. . 

this works fine have ssh container , run make deploy install stuff.

is there way can run make deploy within bootsrap.sh.

the 1 way make entry point every run,

i want when provision host command should run inside container , show me output vagarnt shows host

use docker exec

see doc

http://docs.docker.com/reference/commandline/exec/

for example

docker exec -it container_id make deploy

or

docker exec -it container_id bash

and

make deploy

inside container


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -