Reputation: 58652
I had to perform these steps to deploy my Nodejs/Angular site to AWS via DockerCloud
If we require a small thing changes that require a pull from my project repo. BUT we already deployed our dockers as you may know.
What is the best way pull those changes into the Docker containers that already deployed ?
I hope we don’t have to :
I was thinking
SSH into a VM that has the Docker running
git pull
npm start
Am I on the right track?
Upvotes: 1
Views: 143
Reputation: 350
If you want to treat a Docker container as a VM, you totally can, however, I would strongly caution against this. Anything in a container is ephemeral...if you make changes to files in it and the container goes down, it will not come back up with the changes.
That said, if you have access to the server you can exec into the container and execute whatever commands you want. Usually helpful for dev, but applicable to any container.
This command will start an interactive bash session inside your desired container. See the docs for more info.
docker exec -it <container_name> bash
Best practice would probably be to update the docker image and redeploy it.
Upvotes: 1
Reputation: 1781
You can use docker service update --image
https://docs.docker.com/engine/reference/commandline/service_update/#options
I have not experience with AWS but I think you can build and update automatically.
Upvotes: 1