github.com/amrnt/deis@v1.3.1/docs/using_deis/using-docker-images.rst (about)

     1  :title: Deploying Docker Images on Deis
     2  :description: How to deploy applications on Deis using Docker Images
     3  
     4  .. _using-docker-images:
     5  
     6  Using Docker Images
     7  ===================
     8  Deis supports deploying applications via an existing `Docker Image`_.
     9  This is useful for integrating Deis into Docker-based CI/CD pipelines.
    10  
    11  Prepare an Application
    12  ----------------------
    13  Start by cloning an example application:
    14  
    15  .. code-block:: console
    16  
    17      $ git clone https://github.com/deis/example-go.git
    18      $ cd example-go
    19      $ git checkout docker
    20  
    21  Next use your local ``docker`` client to build the image and push
    22  it to `DockerHub`_.
    23  
    24  .. code-block:: console
    25  
    26      $ docker build -t <username>/example-go .
    27      $ docker push <username>/example-go
    28  
    29  Docker Image Requirements
    30  ^^^^^^^^^^^^^^^^^^^^^^^^^
    31  In order to deploy Docker images, they must conform to the following requirements:
    32  
    33   * The Docker image must EXPOSE only one port
    34   * The exposed port must be an HTTP service that can be connected to an HTTP router
    35   * A default CMD must be specified for running the container
    36  
    37  .. note::
    38  
    39      Docker images which expose more than one port will hit `issue 1156`_.
    40  
    41  Create an Application
    42  ---------------------
    43  Use ``deis create`` to create an application on the :ref:`controller`.
    44  
    45  .. code-block:: console
    46  
    47      $ mkdir -p /tmp/example-go && cd /tmp/example-go
    48      $ deis create
    49      Creating application... done, created example-go
    50  
    51  .. note::
    52  
    53      The ``deis`` client uses the name of the current directory as the
    54      default app name.
    55  
    56  Deploy the Application
    57  ----------------------
    58  Use ``deis pull`` to deploy your application from `DockerHub`_ or
    59  a private registry.
    60  
    61  .. code-block:: console
    62  
    63      $ deis pull gabrtv/example-go:latest
    64      Creating build...  done, v2
    65  
    66      $ curl -s http://example-go.local3.deisapp.com
    67      Powered by Deis
    68  
    69  Because you are deploying a Docker image, the ``cmd`` process type is automatically scaled to 1 on first deploy.
    70  
    71  Use ``deis scale cmd=3`` to increase ``cmd`` processes to 3, for example. Scaling a
    72  process type directly changes the number of :ref:`Containers <container>`
    73  running that process.
    74  
    75  
    76  .. attention::
    77  
    78      Support for Docker registry authentication is coming soon
    79  
    80  
    81  .. _`Docker Image`: https://docs.docker.com/introduction/understanding-docker/
    82  .. _`DockerHub`: https://registry.hub.docker.com/
    83  .. _`CMD instruction`: https://docs.docker.com/reference/builder/#cmd
    84  .. _`issue 1156`: https://github.com/deis/deis/issues/1156