From 1a94a62fe359f73d79df8c67ddb9259600f28000 Mon Sep 17 00:00:00 2001 From: Simen Brekken Date: Thu, 14 Apr 2016 06:28:31 +0200 Subject: [PATCH 1/3] Add CI deployment recipe --- docs/deployment/images.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/deployment/images.md b/docs/deployment/images.md index 9b3602545..2fb78ad98 100644 --- a/docs/deployment/images.md +++ b/docs/deployment/images.md @@ -55,3 +55,36 @@ root@dokku:~# dokku tags:deploy node-js-app v0.9.0 http://node-js-app.dokku.me ``` + +## Deploying image from CI + +To ensure your builds are always reproducible, it's considered bad practice to store build +artifacts in your repository. For some projects however, building artifacts during deployment +to dokku may affect the performance of running applications. + +One solution is to build a finished Docker image on a CI service (or even locally) and deploy +it directly to the host running dokku. + +1. Build image on CI (or locally) + +```sh +$ docker build -t dokku/test-app:v42 +``` + +> Note: The image must be tagged `dokku/:` + +2. Deploy image to dokku host + +```sh +$ docker save dokku/test-app:v42 | ssh my.dokku.host "docker load | dokku tags:deploy test-app v42" +``` + +Here's a more complete example using the above method: + +```sh +#!/bin/bash + +docker build -t dokku/test-app:v42 +docker save dokku/test-app:v42 | bzip2 | ssh my.dokku.host "bunzip2 | docker load" +ssh my.dokku.host "dokku tags:create test-app previous; dokku tags:deploy test-app v42 && dokku tags:create test-app latest" +``` From c6fa0616043d7f99fe035ffba55a24200dfefbbb Mon Sep 17 00:00:00 2001 From: Simen Brekken Date: Thu, 14 Apr 2016 06:55:13 +0200 Subject: [PATCH 2/3] Fix invalid highlighting language --- docs/deployment/images.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/deployment/images.md b/docs/deployment/images.md index 2fb78ad98..5792fc2a6 100644 --- a/docs/deployment/images.md +++ b/docs/deployment/images.md @@ -67,7 +67,7 @@ it directly to the host running dokku. 1. Build image on CI (or locally) -```sh +```shell $ docker build -t dokku/test-app:v42 ``` @@ -75,13 +75,13 @@ $ docker build -t dokku/test-app:v42 2. Deploy image to dokku host -```sh +```shell $ docker save dokku/test-app:v42 | ssh my.dokku.host "docker load | dokku tags:deploy test-app v42" ``` Here's a more complete example using the above method: -```sh +```shell #!/bin/bash docker build -t dokku/test-app:v42 From 579ffa5a62bd18957b632da98a1d962b5984fc0a Mon Sep 17 00:00:00 2001 From: Simen Brekken Date: Thu, 14 Apr 2016 06:55:42 +0200 Subject: [PATCH 3/3] Add Docker Registry note --- docs/deployment/images.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/deployment/images.md b/docs/deployment/images.md index 5792fc2a6..3acaa4a55 100644 --- a/docs/deployment/images.md +++ b/docs/deployment/images.md @@ -79,6 +79,9 @@ $ docker build -t dokku/test-app:v42 $ docker save dokku/test-app:v42 | ssh my.dokku.host "docker load | dokku tags:deploy test-app v42" ``` +> Note: You can also use a Docker Registry to push and pull the image rather than uploading it +> directly. + Here's a more complete example using the above method: ```shell