Reputation: 727
Background: I am using Docker to build my development environment (web-app, nginx, gunicorn, postgress required to mention few). I want my development environment to match production environment. I am now using debian 7 as the base distro, but the question is not Debian related. I do not want docker on the actual production (security updates, monitoring, logging to mention few, but thats different question why not), but i want to use 'real' Debian 7 as the production environment.
Question: Is there way to run the commands building the docker-image as local commands, eg like: docker deploy_to_host <Dockerfile>
that would run the RUN
instructions as root commands etc. That is similar affect as i would have host root command open and copy-paste the commands manually.
Thanks!
Upvotes: 0
Views: 778
Reputation: 104005
It seems to me that you are using the wrong set of tools, so my answer isn't about Docker and this is why:
If you are to deploy on the production environment without Docker and wish to have some kind of automatic process to prepare the machine and deploy the app then you are looking for tools such as:
Once you are decided on how to deploy to production you can then look at your options for your development environment.
Since you are not using Docker in production, there is little interest in using it on your development environment. I would then consider using Vagrant to define one (or more) virtual machines and have Vagrant prepare those VM with the tool you chose for the production env. (Chef, Puppet, SaltStack, Ansible or shell scripts). See Vagrant provisioning.
That will have the advantage of testing your deployment solution as well as testing your app on the development environment and build up the confidence that all this will work as expected when deploying to prod.
Upvotes: 2
Reputation: 1745
You can use remote docker API which covered here
See section 2.3 Misc
and command POST /build
. In few words, you can post tar-file which contains Dockerfile
and its root to docker daemon to build it on remote machine.
UPD: Answer is not actual 'cause of my inattention.
Upvotes: 0