I have project running using several docker containers. Now I want to automate deployment using Jenkins (push triggers). I have three scenarios but I like none of them. here are these three different scenarios:
1) I deploy changes on server, then on server I run docker-compose build
, to recreate potentially changed images and then run containers.
downside - I don't build these new images on my host, but just on the server, so I can't be sure that build will occur successfully, It may be buggy and cause several errors without first checking.
2) I can first check that project builds successfully but first running docker-compose build
on my Jenkins server and deploying after that.
downside - I run docker-compose build
two times. on my Jenkins server and on the production server.
3) I can build on my Jenkins server, then push it on docker hub and pull on server. so I build only once.
downside - as I said I have several images. so in this scenario I have to upload maybe 6 images on the docker hub and then pull them on server.
As I said I don't want to use any of these because of their downsides. So maybe there are other better way of doing things like that?