ufo 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/bin/commit_docs.sh +26 -0
- data/.circleci/config.yml +13 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +6 -4
- data/Rakefile +7 -0
- data/docs/_config.yml +3 -0
- data/docs/_docs/conventions.md +3 -3
- data/docs/_docs/install.md +5 -5
- data/docs/_docs/settings.md +3 -3
- data/docs/_docs/structure.md +2 -2
- data/docs/_docs/tutorial-ufo-docker-build.md +1 -1
- data/docs/_docs/tutorial-ufo-init.md +1 -1
- data/docs/_docs/tutorial-ufo-ship.md +3 -7
- data/docs/_docs/tutorial-ufo-ships.md +2 -2
- data/docs/_docs/tutorial-ufo-tasks-build.md +7 -7
- data/docs/_docs/tutorial.md +1 -1
- data/docs/_docs/ufo-env.md +5 -5
- data/docs/_docs/ufo-tasks-register.md +0 -4
- data/docs/_docs/variables.md +6 -7
- data/docs/_includes/content.html +5 -0
- data/docs/_includes/css/main.css +23 -4
- data/docs/_includes/css/ufo.css +9 -9
- data/docs/_includes/reference.md +5 -0
- data/docs/_includes/subnav.html +16 -33
- data/docs/_reference/ufo-completion.md +46 -0
- data/docs/_reference/ufo-completion_script.md +27 -0
- data/docs/_reference/ufo-deploy.md +51 -0
- data/docs/_reference/ufo-destroy.md +34 -0
- data/docs/{_docs → _reference}/ufo-docker-base.md +36 -17
- data/docs/_reference/ufo-docker-build.md +81 -0
- data/docs/_reference/ufo-docker-clean.md +44 -0
- data/docs/_reference/ufo-docker-help.md +15 -0
- data/docs/_reference/ufo-docker-name.md +37 -0
- data/docs/_reference/ufo-docker-push.md +49 -0
- data/docs/_reference/ufo-docker.md +35 -0
- data/docs/_reference/ufo-init.md +74 -0
- data/docs/_reference/ufo-scale.md +30 -0
- data/docs/_reference/ufo-ship.md +100 -0
- data/docs/_reference/ufo-ships.md +77 -0
- data/docs/_reference/ufo-task.md +37 -0
- data/docs/_reference/ufo-tasks-build.md +179 -0
- data/docs/_reference/ufo-tasks-help.md +15 -0
- data/docs/_reference/ufo-tasks-register.md +29 -0
- data/docs/_reference/ufo-tasks.md +35 -0
- data/docs/_reference/ufo-upgrade3.md +23 -0
- data/docs/_reference/ufo-version.md +23 -0
- data/docs/articles.md +2 -0
- data/docs/docs.md +3 -3
- data/docs/quick-start.md +2 -2
- data/docs/reference.md +18 -0
- data/lib/ufo/cli.rb +13 -13
- data/lib/ufo/docker.rb +5 -5
- data/lib/ufo/ecr/auth.rb +6 -1
- data/lib/ufo/ecr/cleaner.rb +1 -1
- data/lib/ufo/help/completion.md +1 -1
- data/lib/ufo/help/completions.md +1 -1
- data/lib/ufo/help/deploy.md +5 -1
- data/lib/ufo/help/destroy.md +7 -3
- data/lib/ufo/help/docker.md +1 -1
- data/lib/ufo/help/docker/base.md +34 -4
- data/lib/ufo/help/docker/build.md +59 -4
- data/lib/ufo/help/docker/clean.md +12 -6
- data/lib/ufo/help/docker/name.md +10 -10
- data/lib/ufo/help/docker/push.md +23 -6
- data/lib/ufo/help/hello.md +1 -1
- data/lib/ufo/help/init.md +43 -5
- data/lib/ufo/help/scale.md +4 -3
- data/lib/ufo/help/ship.md +59 -8
- data/lib/ufo/help/ships.md +35 -9
- data/lib/ufo/help/task.md +1 -1
- data/lib/ufo/help/tasks.md +1 -1
- data/lib/ufo/help/tasks/build.md +155 -4
- data/lib/ufo/help/tasks/register.md +12 -3
- data/lib/ufo/ship.rb +2 -4
- data/lib/ufo/tasks.rb +2 -2
- data/lib/ufo/version.rb +1 -1
- data/spec/lib/ship_spec.rb +2 -1
- data/ufo.gemspec +3 -3
- metadata +44 -21
- data/docs/_docs/commands.md +0 -10
- data/docs/_docs/ufo-deploy.md +0 -30
- data/docs/_docs/ufo-destroy.md +0 -19
- data/docs/_docs/ufo-docker-build.md +0 -79
- data/docs/_docs/ufo-docker-clean.md +0 -27
- data/docs/_docs/ufo-docker-name.md +0 -15
- data/docs/_docs/ufo-docker-push.md +0 -43
- data/docs/_docs/ufo-help.md +0 -22
- data/docs/_docs/ufo-init.md +0 -54
- data/docs/_docs/ufo-scale.md +0 -21
- data/docs/_docs/ufo-ship.md +0 -75
- data/docs/_docs/ufo-ships.md +0 -52
- data/docs/_docs/ufo-tasks-build.md +0 -166
- data/lib/ufo/completion.rb +0 -15
- data/lib/ufo/sub.rb +0 -12
data/docs/_includes/content.html
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
<section id="main">
|
|
9
9
|
<div class="container">
|
|
10
10
|
<div class="row">
|
|
11
|
+
{% if page.reference %}
|
|
12
|
+
<div class="col-md-9 reference-nav">
|
|
13
|
+
<a href="/reference">Back to Reference Index</a>
|
|
14
|
+
</div>
|
|
15
|
+
{% endif %}
|
|
11
16
|
<div class="col-md-9 content-body">
|
|
12
17
|
<h2>{{ page.title }}</h2>
|
|
13
18
|
{{ content }}
|
data/docs/_includes/css/main.css
CHANGED
|
@@ -9,11 +9,21 @@ body {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
p {
|
|
12
|
-
font-size: 20px
|
|
12
|
+
/*font-size: 20px;*/
|
|
13
|
+
font-size: 1.2em;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
p.small {
|
|
16
|
-
font-size: 16px
|
|
17
|
+
/*font-size: 16px;*/
|
|
18
|
+
font-size: 1em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pre code {
|
|
22
|
+
font-size: 0.85em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
code {
|
|
26
|
+
font-size: 0.75em;
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
a,
|
|
@@ -31,7 +41,7 @@ h3,
|
|
|
31
41
|
h4,
|
|
32
42
|
h5,
|
|
33
43
|
h6 {
|
|
34
|
-
text-transform: uppercase
|
|
44
|
+
/*text-transform: uppercase;*/
|
|
35
45
|
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
36
46
|
font-weight: 700;
|
|
37
47
|
}
|
|
@@ -201,7 +211,11 @@ section {
|
|
|
201
211
|
section h2 {
|
|
202
212
|
margin: 0;
|
|
203
213
|
margin-bottom: 15px;
|
|
204
|
-
font-size:
|
|
214
|
+
font-size: 1.6em;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
section h3 {
|
|
218
|
+
font-size: 1.4em;
|
|
205
219
|
}
|
|
206
220
|
|
|
207
221
|
section.success {
|
|
@@ -479,3 +493,8 @@ footer .footer-below {
|
|
|
479
493
|
transform: translateZ(0);
|
|
480
494
|
-webkit-transform: translateZ(0);
|
|
481
495
|
}
|
|
496
|
+
|
|
497
|
+
.reference-nav {
|
|
498
|
+
margin-bottom: 20px;
|
|
499
|
+
}
|
|
500
|
+
|
data/docs/_includes/css/ufo.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
ol.overview-stages li {
|
|
2
|
-
font-size: 1.1em
|
|
2
|
+
/*font-size: 1.1em;*/
|
|
3
3
|
padding: 10px 0;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
section#main {
|
|
7
|
-
text-align: center
|
|
7
|
+
/*text-align: center;*/
|
|
8
8
|
color: #fff;
|
|
9
9
|
background: #{{ site.color.primary }};
|
|
10
10
|
}
|
|
@@ -23,12 +23,12 @@ section#main .intro-text .name {
|
|
|
23
23
|
display: block;
|
|
24
24
|
text-transform: uppercase;
|
|
25
25
|
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
26
|
-
font-size: 2em
|
|
26
|
+
/*font-size: 2em;*/
|
|
27
27
|
font-weight: 700;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
section#main .intro-text .skills {
|
|
31
|
-
font-size: 1.25em
|
|
31
|
+
/*font-size: 1.25em;*/
|
|
32
32
|
font-weight: 300;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -43,11 +43,11 @@ section#main .intro-text .skills {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
section#main .intro-text .name {
|
|
46
|
-
font-size: 4.75em
|
|
46
|
+
/*font-size: 4.75em;*/
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
section#main .intro-text .skills {
|
|
50
|
-
font-size: 1.75em
|
|
50
|
+
/*font-size: 1.75em;*/
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -56,7 +56,7 @@ section#main .intro-text .skills {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.content-body h2 {
|
|
59
|
-
text-align: center
|
|
59
|
+
/*text-align: center;*/
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.content-body ul,
|
|
@@ -71,7 +71,7 @@ section#main .intro-text .skills {
|
|
|
71
71
|
.content-nav {
|
|
72
72
|
/*background-color: green;*/
|
|
73
73
|
margin-top: 40px;
|
|
74
|
-
font-size: 1.
|
|
74
|
+
font-size: 1.2em;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
.content-nav ul, .content-nav ol {
|
|
@@ -166,7 +166,7 @@ table.ship-options td:first-child {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
#summary {
|
|
169
|
-
font-size: 18px
|
|
169
|
+
/*font-size: 18px;*/
|
|
170
170
|
padding-bottom: 0;
|
|
171
171
|
margin-bottom: 0;
|
|
172
172
|
}
|
data/docs/_includes/subnav.html
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
<div class="col-md-3 content-nav">
|
|
2
2
|
<ul>
|
|
3
3
|
<li><a href="{% link quick-start.md %}">Quick Start</a></li>
|
|
4
|
-
<li><a href="{% link
|
|
5
|
-
<ul>
|
|
6
|
-
<li><a href="{% link _docs/install.md %}">Installation</a></li>
|
|
7
|
-
<li><a href="{% link _docs/structure.md %}">Structure</a></li>
|
|
8
|
-
</ul>
|
|
9
|
-
</li>
|
|
4
|
+
<li><a href="{% link _docs/install.md %}">Installation</a></li>
|
|
10
5
|
<li><a href="{% link _docs/tutorial.md %}">Tutorial</a>
|
|
11
6
|
<ul class="tutorial">
|
|
12
7
|
<li><a href="{% link _docs/tutorial-ufo-init.md %}">Setup Ufo</a></li>
|
|
@@ -16,35 +11,23 @@
|
|
|
16
11
|
<li><a href="{% link _docs/tutorial-ufo-ships.md %}">Deploy Multiple Apps</a></li>
|
|
17
12
|
</ul>
|
|
18
13
|
</li>
|
|
19
|
-
<li><a href="{% link
|
|
14
|
+
<li><a href="{% link docs.md %}">Docs</a>
|
|
20
15
|
<ul>
|
|
21
|
-
<li><a href="{% link _docs/
|
|
22
|
-
<li><a href="{% link _docs/
|
|
23
|
-
<li><a href="{% link _docs/ufo-
|
|
24
|
-
<li><a href="{% link _docs/
|
|
25
|
-
<li><a href="{% link _docs/
|
|
26
|
-
<li><a href="{% link _docs/
|
|
27
|
-
<li><a href="{% link _docs/
|
|
28
|
-
<li><a href="{% link _docs/
|
|
29
|
-
<li><a href="{% link _docs/
|
|
30
|
-
<li><a href="{% link _docs/
|
|
31
|
-
<li><a href="{% link _docs/
|
|
32
|
-
<li><a href="{% link _docs/
|
|
33
|
-
<li><a href="{% link
|
|
34
|
-
<li><a href="{% link
|
|
16
|
+
<li><a href="{% link _docs/structure.md %}">Structure</a></li>
|
|
17
|
+
<li><a href="{% link _docs/settings.md %}">Settings</a></li>
|
|
18
|
+
<li><a href="{% link _docs/ufo-env.md %}">UFO_ENV</a></li>
|
|
19
|
+
<li><a href="{% link _docs/variables.md %}">Shared Variables</a></li>
|
|
20
|
+
<li><a href="{% link _docs/helpers.md %}">Helpers</a></li>
|
|
21
|
+
<li><a href="{% link _docs/conventions.md %}">Conventions</a></li>
|
|
22
|
+
<li><a href="{% link _docs/auto-completion.md %}">Auto-Completion</a></li>
|
|
23
|
+
<li><a href="{% link _docs/run-in-pieces.md %}">Run In Pieces</a></li>
|
|
24
|
+
<li><a href="{% link _docs/single-task.md %}">Run Single Task</a></li>
|
|
25
|
+
<li><a href="{% link _docs/migrations.md %}">Database Migrations</a></li>
|
|
26
|
+
<li><a href="{% link _docs/automated-cleanup.md %}">Automated Cleanup</a></li>
|
|
27
|
+
<li><a href="{% link _docs/next-steps.md %}">Next Steps</a></li>
|
|
28
|
+
<li><a href="{% link articles.md %}">Articles</a></li>
|
|
29
|
+
<li><a href="{% link reference.md %}">Reference</a></li>
|
|
35
30
|
</ul>
|
|
36
31
|
</li>
|
|
37
|
-
<li><a href="{% link _docs/settings.md %}">Settings</a></li>
|
|
38
|
-
<li><a href="{% link _docs/ufo-env.md %}">UFO_ENV</a></li>
|
|
39
|
-
<li><a href="{% link _docs/variables.md %}">Shared Variables</a></li>
|
|
40
|
-
<li><a href="{% link _docs/helpers.md %}">Helpers</a></li>
|
|
41
|
-
<li><a href="{% link _docs/conventions.md %}">Conventions</a></li>
|
|
42
|
-
<li><a href="{% link _docs/auto-completion.md %}">Auto-Completion</a></li>
|
|
43
|
-
<li><a href="{% link _docs/run-in-pieces.md %}">Run In Pieces</a></li>
|
|
44
|
-
<li><a href="{% link _docs/single-task.md %}">Run Single Task</a></li>
|
|
45
|
-
<li><a href="{% link _docs/migrations.md %}">Database Migrations</a></li>
|
|
46
|
-
<li><a href="{% link _docs/automated-cleanup.md %}">Automated Cleanup</a></li>
|
|
47
|
-
<li><a href="{% link _docs/next-steps.md %}">Next Steps</a></li>
|
|
48
|
-
<li><a href="{% link articles.md %}">Articles</a></li>
|
|
49
32
|
</ul>
|
|
50
33
|
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ufo completion
|
|
3
|
+
reference: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
ufo completion *PARAMS
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Prints words for auto-completion.
|
|
13
|
+
|
|
14
|
+
Example:
|
|
15
|
+
|
|
16
|
+
ufo completion
|
|
17
|
+
|
|
18
|
+
Prints words for TAB auto-completion.
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
ufo completion
|
|
23
|
+
ufo completion hello
|
|
24
|
+
ufo completion hello name
|
|
25
|
+
|
|
26
|
+
To enable, TAB auto-completion add the following to your profile:
|
|
27
|
+
|
|
28
|
+
eval $(ufo completion_script)
|
|
29
|
+
|
|
30
|
+
Auto-completion example usage:
|
|
31
|
+
|
|
32
|
+
ufo [TAB]
|
|
33
|
+
ufo hello [TAB]
|
|
34
|
+
ufo hello name [TAB]
|
|
35
|
+
ufo hello name --[TAB]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Options
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
[--verbose], [--no-verbose]
|
|
42
|
+
[--mute], [--no-mute]
|
|
43
|
+
[--noop], [--no-noop]
|
|
44
|
+
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
|
45
|
+
```
|
|
46
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ufo completion_script
|
|
3
|
+
reference: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
ufo completion_script
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Generates a script that can be eval to setup auto-completion.
|
|
13
|
+
|
|
14
|
+
To use, add the following to your ~/.bashrc or ~/.profile
|
|
15
|
+
|
|
16
|
+
eval $(ufo completion_script)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Options
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
[--verbose], [--no-verbose]
|
|
23
|
+
[--mute], [--no-mute]
|
|
24
|
+
[--noop], [--no-noop]
|
|
25
|
+
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
|
26
|
+
```
|
|
27
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ufo deploy
|
|
3
|
+
reference: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
ufo deploy SERVICE
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Deploy task definition to ECS service without re-building the definition.
|
|
13
|
+
|
|
14
|
+
It is useful to sometimes deploy only the task definition without re-building it. Say for example, you are debugging the task definition and just want to directly edit the `.ufo/output/hi-web.json` definition. You can accomplish this with the `ufo deploy` command. The `ufo deploy` command will deploy the task definition in `.ufo/output` unmodified. Example:
|
|
15
|
+
|
|
16
|
+
ufo deploy hi-web
|
|
17
|
+
|
|
18
|
+
The above command does the following:
|
|
19
|
+
|
|
20
|
+
1. register the `.ufo/output/hi-web.json` task definition to ECS untouched.
|
|
21
|
+
2. deploys it to ECS by updating the service
|
|
22
|
+
|
|
23
|
+
The `ufo deploy` command does less than the `ufo ship` command. Typically, people use `ufo ship` over the `ufo deploy` command do everything in one step:
|
|
24
|
+
|
|
25
|
+
1. build the Docker image
|
|
26
|
+
2. register the ECS task definition
|
|
27
|
+
3. update the ECS service
|
|
28
|
+
|
|
29
|
+
The `ufo ships`, `ufo ship`, `ufo deploy` command support the same options. The options are presented here again for convenience:
|
|
30
|
+
|
|
31
|
+
{% include ufo-ship-options.md %}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Options
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
[--task=TASK] # ECS task name, to override the task name convention.
|
|
38
|
+
[--target-group=TARGET_GROUP] # ELB Target Group ARN.
|
|
39
|
+
[--target-group-prompt], [--no-target-group-prompt] # Enable Target Group ARN prompt
|
|
40
|
+
# Default: true
|
|
41
|
+
[--wait], [--no-wait] # Wait for deployment to complete
|
|
42
|
+
[--pretty], [--no-pretty] # Pretty format the json for the task definitions
|
|
43
|
+
# Default: true
|
|
44
|
+
[--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks after waiting for deploying to complete
|
|
45
|
+
[--ecr-keep=N] # ECR specific cleanup of old images. Specifies how many images to keep. Only runs if the images are ECR images. Defaults keeps all images.
|
|
46
|
+
[--verbose], [--no-verbose]
|
|
47
|
+
[--mute], [--no-mute]
|
|
48
|
+
[--noop], [--no-noop]
|
|
49
|
+
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
|
50
|
+
```
|
|
51
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ufo destroy
|
|
3
|
+
reference: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
ufo destroy SERVICE
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Destroy the ECS service.
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
Ufo provides a quick way to destroy an ECS service. To destroy an ECS service, you must make sure that the desired number of tasks is first set to 0. It is easy to forget to do this and waste time. So as part of destroying the service ufo will scale the ECS service down to 0 automatically first and then destroys the service. Ufo also prompts you before destroying the service.
|
|
17
|
+
|
|
18
|
+
ufo destroy hi-web
|
|
19
|
+
|
|
20
|
+
If you would like to bypass the prompt, you can use the `--sure` option.
|
|
21
|
+
|
|
22
|
+
ufo destroy hi-web --sure
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Options
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
[--sure], [--no-sure] # By pass are you sure prompt.
|
|
29
|
+
[--verbose], [--no-verbose]
|
|
30
|
+
[--mute], [--no-mute]
|
|
31
|
+
[--noop], [--no-noop]
|
|
32
|
+
[--cluster=CLUSTER] # Cluster. Overrides ufo/settings.yml.
|
|
33
|
+
```
|
|
34
|
+
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: ufo docker base
|
|
3
|
+
reference: true
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
ufo docker base
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Build docker image from `Dockerfile.base` and update current `Dockerfile`.
|
|
13
|
+
|
|
14
|
+
The docker cache task builds a docker image using the `Dockerfile.base` file and
|
|
15
|
+
updates the FROM `Dockerfile` image with the generated image from `Dockerfile.base`.
|
|
16
|
+
|
|
17
|
+
## Summarized Example
|
|
18
|
+
|
|
19
|
+
ufo docker base
|
|
20
|
+
ufo docker base --no-push # do not push the image to the registry
|
|
21
|
+
|
|
22
|
+
Docker image `tongueroo/hi:base-2016-10-21T15-50-57-88071f5` built.
|
|
23
|
+
|
|
24
|
+
## Concept
|
|
6
25
|
|
|
7
26
|
Docker is fantastic and has given developers more power and control over the OS their application runs on. Sometimes building Docker images can be slow though. Docker layer caching technology helps immensely to speed up the process as Docker will only rebuild layers that require rebuilding. But sometimes one little dependency changes it results in having to rebuild many layers.
|
|
8
27
|
|
|
@@ -10,33 +29,33 @@ The `ufo docker base` commands allows you to build an Docker image from `Dockerf
|
|
|
10
29
|
|
|
11
30
|
There are pros and cons of using this approach. Remember there are 2 hard problems in computer science: 1. Naming and 2. Caching. The main con about this approach is if you forget to update the base Docker image you will have cached artifacts that will not disappear unless you rebuild the base Docker image. While some folks are completely against introducing this cache layer, some have found it being a huge win in speeding up their Docker development workflow. If you are using this technique it is recommended that you set up some automation that rebuilds the base Docker image at least nightly.
|
|
12
31
|
|
|
13
|
-
|
|
32
|
+
## Demo
|
|
14
33
|
|
|
15
34
|
To demonstrate this command, there's a `docker-cache` branch in the [tongueroo/hi](https://github.com/tongueroo/hi/tree/docker-cache) repo.
|
|
16
35
|
|
|
17
36
|
Let's see the command in action:
|
|
18
37
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
tongueroo/hi:base-2017-06-12T14-36-44-2af505e
|
|
27
|
-
```
|
|
38
|
+
ufo docker base
|
|
39
|
+
Building docker image with:
|
|
40
|
+
docker build -t tongueroo/hi:base-2017-06-12T14-36-44-2af505e -f Dockerfile.base .
|
|
41
|
+
...
|
|
42
|
+
Pushed tongueroo/hi:base-2017-06-12T14-36-44-2af505e docker image. Took 28s.
|
|
43
|
+
The Dockerfile FROM statement has been updated with the latest base image:
|
|
44
|
+
tongueroo/hi:base-2017-06-12T14-36-44-2af505e
|
|
28
45
|
|
|
29
46
|
Some of the output has been excluded so we can focus on the important parts to point out. First notice that the commmand simply shells out to the docker command and calls:
|
|
30
47
|
|
|
31
|
-
|
|
32
|
-
docker build -t tongueroo/hi:base-2017-06-12T14-36-44-2af505e -f Dockerfile.base .
|
|
33
|
-
```
|
|
48
|
+
docker build -t tongueroo/hi:base-2017-06-12T14-36-44-2af505e -f Dockerfile.base .
|
|
34
49
|
|
|
35
50
|
It is using the docker `-f Dockerfile.base` option to build the base image. It names the image with `tongueroo/hi:base-2017-06-12T14-36-44-2af505e`. The image tag contains useful information: the timestamp when the image was built and the exact git sha of the code. The image gets push to a registry immediately.
|
|
36
51
|
|
|
37
52
|
Notice at the very end, the *current* `Dockerfile`'s FROM statement has been updated with the newly built base Docker image automatically. This saves you from forgetting to copying and pasting it the `Dockerfile` yourself.
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
|
|
55
|
+
## Options
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
[--push], [--no-push]
|
|
59
|
+
# Default: true
|
|
60
|
+
```
|
|
42
61
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ufo docker build
|
|
3
|
+
reference: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
ufo docker build
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
Build docker image.
|
|
13
|
+
|
|
14
|
+
The `ufo docker build` builds a Docker image using the Dockerfile in the current project folder. This simply is a wrapper command that shells out and calls the `docker` command. We're use the [tongueroo/hi](https://github.com/tongueroo/hi) project and it's Dockerfile for demonstration. Example:
|
|
15
|
+
|
|
16
|
+
ufo docker build
|
|
17
|
+
|
|
18
|
+
You'll see that it calls:
|
|
19
|
+
|
|
20
|
+
docker build -t tongueroo/hi:ufo-2017-06-11T22-18-03-a18aa30 -f Dockerfile .
|
|
21
|
+
|
|
22
|
+
You should see similar output (some of the output has been truncated for conciseness):
|
|
23
|
+
|
|
24
|
+
$ ufo docker build
|
|
25
|
+
Building docker image with:
|
|
26
|
+
docker build -t tongueroo/hi:ufo-2017-06-11T22-18-03-a18aa30 -f Dockerfile .
|
|
27
|
+
Sending build context to Docker daemon 734.2 kB
|
|
28
|
+
Step 1 : FROM ruby:2.3.3
|
|
29
|
+
---> 0e1db669d557
|
|
30
|
+
Step 2 : RUN apt-get update && apt-get install -y build-essential nodejs && rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get purge
|
|
31
|
+
---> Using cache
|
|
32
|
+
---> 931ace833716
|
|
33
|
+
...
|
|
34
|
+
Step 7 : ADD . /app
|
|
35
|
+
---> fae2452e6c35
|
|
36
|
+
Removing intermediate container 4c93f92a7fd8
|
|
37
|
+
Step 8 : RUN bundle install --system
|
|
38
|
+
---> Running in f851b9cb7d27
|
|
39
|
+
Using rake 12.0.0
|
|
40
|
+
Using i18n 0.8.1
|
|
41
|
+
...
|
|
42
|
+
Using web-console 2.3.0
|
|
43
|
+
Bundle complete! 12 Gemfile dependencies, 56 gems now installed.
|
|
44
|
+
Bundled gems are installed into /usr/local/bundle.
|
|
45
|
+
---> 194830c5c1a8
|
|
46
|
+
...
|
|
47
|
+
Removing intermediate container 67545cd4cd09
|
|
48
|
+
Step 11 : CMD bin/web
|
|
49
|
+
---> Running in b1b26e68d957
|
|
50
|
+
---> 8547bb48b21f
|
|
51
|
+
Removing intermediate container b1b26e68d957
|
|
52
|
+
Successfully built 8547bb48b21f
|
|
53
|
+
Docker image tongueroo/hi:ufo-2017-06-11T22-18-03-a18aa30 built. Took 33s.
|
|
54
|
+
$
|
|
55
|
+
|
|
56
|
+
The docker image tag that is generated contains a useful timestamp and the current HEAD git sha of the project that you are on.
|
|
57
|
+
|
|
58
|
+
By default when you are running `ufo docker build` directly it does not push the docker image to the registry. If you would like it to automaticaly push the built image to a registry at the end of the build use the `--push` flag.
|
|
59
|
+
|
|
60
|
+
ufo docker build --push
|
|
61
|
+
|
|
62
|
+
You should see it being pushed at the end:
|
|
63
|
+
|
|
64
|
+
Docker image tongueroo/hi:ufo-2017-06-11T22-22-32-a18aa30 built. Took 34s.
|
|
65
|
+
The push refers to a repository [docker.io/tongueroo/hi]
|
|
66
|
+
ef375857f165: Pushed
|
|
67
|
+
4d791d7cde66: Pushed
|
|
68
|
+
277ff31e79b4: Layer already exists
|
|
69
|
+
a361a4de05df: Layer already exists
|
|
70
|
+
ufo-2017-06-11T22-22-32-a18aa30: digest: sha256:c5385a5084e87643bd943eb120e110321c59e8acd30736ba7b5223eb1143baa8 size: 3464
|
|
71
|
+
Pushed tongueroo/hi:ufo-2017-06-11T22-22-32-a18aa30 docker image. Took 9s.
|
|
72
|
+
|
|
73
|
+
Note in order to push the image to a registry you will need to login into the registry. If you are using DockerHub use the `docker login` command. If you are using AWS ECR then you can use the `aws ecr get-login` command.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## Options
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
[--push], [--no-push]
|
|
80
|
+
```
|
|
81
|
+
|