Skip to content

Commit 4e9fcb1

Browse files
author
Gabriel Monroy
committed
docs(using_deis): add Using Docker Images section
1 parent 8f70ad9 commit 4e9fcb1

4 files changed

Lines changed: 100 additions & 7 deletions

File tree

docs/using_deis/deploy-application.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Deploying a Docker image onto Deis allows you to take a Docker image from either
5252
or a private registry and copy it over bit-for-bit, ensuring that you are running the same
5353
image in development or in your CI pipeline as you are in production.
5454

55+
Learn how to use deploy applications on Deis :ref:`using-docker-images`.
56+
5557

5658
.. _`twelve-factor methodology`: http://12factor.net/
5759
.. _`Heroku Buildpacks`: https://devcenter.heroku.com/articles/buildpacks

docs/using_deis/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Using Deis
1717
deploy-application
1818
using-buildpacks
1919
using-dockerfiles
20+
using-docker-images
2021
config-application
2122
manage-application
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
.. attention::
42+
43+
Support for non-HTTP services is coming soon
44+
45+
Create an Application
46+
---------------------
47+
Use ``deis create`` to create an application on the :ref:`controller`.
48+
49+
.. code-block:: console
50+
51+
$ mkdir -p /tmp/example-go && cd /tmp/example-go
52+
$ deis create
53+
Creating application... done, created example-go
54+
55+
.. note::
56+
57+
The ``deis`` client uses the name of the current directory as the
58+
default app name.
59+
60+
Deploy the Application
61+
----------------------
62+
Use ``deis pull`` to deploy your application from `DockerHub`_ or
63+
a private registry.
64+
65+
.. code-block:: console
66+
67+
$ deis pull gabrtv/example-go:latest
68+
Creating build... done, v2
69+
70+
$ curl -s http://example-go.local3.deisapp.com
71+
Powered by Deis
72+
73+
Because you are deploying a Docker image, the ``cmd`` process type is automatically scaled to 1 on first deploy.
74+
75+
.. attention::
76+
77+
Support for Docker registry authentication is coming soon
78+
79+
Define Process Types
80+
--------------------
81+
Docker containers have a default command usually specified by a `CMD instruction`_.
82+
Deis uses the ``cmd`` process type to refer to this default command.
83+
84+
Process types other than ``cmd`` are not supported when using Docker images.
85+
86+
87+
.. _`Docker Image`: http://docs.docker.io/introduction/understanding-docker/
88+
.. _`DockerHub`: https://registry.hub.docker.com/
89+
.. _`CMD instruction`: http://docs.docker.io/reference/builder/#cmd
90+
.. _`issue 1156`: https://github.com/deis/deis/issues/1156

docs/using_deis/using-dockerfiles.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ If you do not have an existing application, you can clone an example application
1919
2020
Dockerfile Requirements
2121
^^^^^^^^^^^^^^^^^^^^^^^
22-
In order to deploy Dockerfile applications, they must conform to the following guidelines:
22+
In order to deploy Dockerfile applications, they must conform to the following requirements:
2323

2424
* The Dockerfile must EXPOSE only one port
25-
* The first exposed port must be an HTTP service that can be connected to an HTTP router
25+
* The exposed port must be an HTTP service that can be connected to an HTTP router
2626
* A default CMD must be specified for running the container
2727

2828
.. note::
@@ -57,7 +57,7 @@ Use ``git push deis master`` to deploy your application.
5757
Total 13 (delta 2), reused 0 (delta 0)
5858
-----> Building Docker image
5959
Uploading context 4.096 kB
60-
Uploading context
60+
Uploading context
6161
Step 0 : FROM deis/base:latest
6262
---> 60024338bc63
6363
Step 1 : MAINTAINER OpDemand <info@opdemand.com>
@@ -100,17 +100,17 @@ Use ``git push deis master`` to deploy your application.
100100
Removing intermediate container 7eb8ec45dcb0
101101
Successfully built ea1a8cc93ca3
102102
-----> Pushing image to private registry
103-
103+
104104
Launching... done, v2
105-
105+
106106
-----> folksy-offshoot deployed to Deis
107107
http://folksy-offshoot.local.deisapp.com
108108
109109
To learn more, use `deis help` or visit http://deis.io
110110
111111
To ssh://git@local.deisapp.com:2222/folksy-offshoot.git
112112
* [new branch] master -> master
113-
113+
114114
$ curl -s http://folksy-offshoot.local.deisapp.com
115115
Welcome to Deis!
116116
See the documentation at http://docs.deis.io/ for more information.
@@ -132,4 +132,4 @@ Deis also supports scaling other process types as defined in a `Procfile`_. To
132132
.. _`Docker Image`: http://docs.docker.io/introduction/understanding-docker/
133133
.. _`CMD instruction`: http://docs.docker.io/reference/builder/#cmd
134134
.. _`issue 1156`: https://github.com/deis/deis/issues/1156
135-
.. _`Procfile`: https://devcenter.heroku.com/articles/procfile
135+
.. _`Procfile`: https://devcenter.heroku.com/articles/procfile

0 commit comments

Comments
 (0)