Deploy a docker container to production

I have create a docker image on my dev machine and tested my RAILS code on it.
The container uses code from the host this way :

docker run -v [/path/to/dir/to/mount/on/local/machine/]:[/desired/path/in/docker/] -p [port to forward] -i -t [name of image] /bin/bash

Now I would like to push the container to a preproduct environment and then a production environment.

  • how to run chown in Bluemix container to write to a Bluemix volume
  • Graceful Shutdown of HDFS with Docker
  • Jenkins: Pipeline Docker Job with Jenkins file - Docker groovy syntax
  • Docker pull from inside vagrant box requires constant pressing of key
  • How to ship java based web application in AWS cloud using docker
  • is it possible to make a docker image from a debian image
  • What is the best way to do that ?
    Should I install docker on the preprod/prod servers and then use the image ?

    Or should I configure my staging to be identitical to my image and upload my source code ?

  • maven plugin for docker (e.g. to run with needed db)
  • what is the usages of dvjy3tqbc323p.cloudfront.net in docker?
  • AWS ECS Docker - nginx: [emerg] host not found in upstream
  • Can we control the k8s node run container members?
  • Error Pulling private docker repository from mac Boot2Docker
  • Docker - port prevents listening
  • One Solution collect form web for “Deploy a docker container to production”

    Are you deploying a rails app? I would take a look at Dokku which is basically a self hosted version of heroku.

    If you want to use docker directly I would take a look at using a deployment script of some type to help you with this. Basically it can login via ssh, git clone the code to a directory and then run the docker image with the new directory (stopping any existing instances). But again Dokku makes this way simpler.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.