Skip to content

Commit 8aca1eb

Browse files
committed
1 parent 240ffff commit 8aca1eb

2 files changed

Lines changed: 23 additions & 17 deletions

File tree

chapters/docker-image.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _Dockerfile_ is usually called _Dockerfile_. The complete list of commands that
2626

2727
=== Create your first Docker image
2828

29-
_Hello World_ Dockerfile is shown:
29+
Create a new text file _Dockerfile_ in an empty directory and use the following contents:
3030

3131
.Hello World Dockerfile
3232
[source, text]
@@ -90,9 +90,9 @@ ubuntu latest a5a467fddcb8 2 days ago
9090
busybox latest 3d5bcd78e074 4 days ago 1.113 MB
9191
----
9292

93-
==== Run WildFly
93+
=== Run WildFly
9494

95-
Create a new text file _Dockerfile_ in an empty directory:
95+
Create a new text file _Dockerfile_ in an empty directory and use the following contents:
9696

9797
[source, text]
9898
----
@@ -107,7 +107,7 @@ Run the container:
107107

108108
docker run -it mywildfly
109109

110-
==== Deploy Java EE 7 Application
110+
=== Deploy Java EE 7 Application
111111

112112
Create a new text file _Dockerfile_ in an empty directory:
113113

@@ -129,6 +129,8 @@ Build the image:
129129

130130
docker build -t movieplex .
131131

132+
=== Dockerfile Command Design Patterns
133+
132134
==== Difference between CMD and ENTRYPOINT
133135

134136
*TL;DR* `CMD` will work for most of the cases.
@@ -166,7 +168,7 @@ This command overrides the entry point to the container to `/bin/cat`. The argum
166168
. Allows tar file auto-extraction in the image, for example, `ADD app.tar.gz /opt/var/myapp`.
167169
. Allows files to be downloaded from a remote URL. However, the downloaded files will become part of the image. This causes the image size to bloat. So its recommended to use `curl` or `wget` to download the archive explicitly, extract, and remove the archive.
168170

169-
=== Import and export images
171+
==== Import and export images
170172

171173
Docker images can be saved using `save` command to a .tar file:
172174

readme.html

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -459,15 +459,16 @@ <h1>Docker and Kubernetes for Java Developers</h1>
459459
<li><a href="#_docker_image">Docker Image</a>
460460
<ul class="sectlevel2">
461461
<li><a href="#_dockerfile">Dockerfile</a></li>
462-
<li><a href="#_create_your_first_docker_image">Create your first Docker image</a>
463-
<ul class="sectlevel3">
462+
<li><a href="#_create_your_first_docker_image">Create your first Docker image</a></li>
464463
<li><a href="#_run_wildfly">Run WildFly</a></li>
465464
<li><a href="#_deploy_java_ee_7_application">Deploy Java EE 7 Application</a></li>
465+
<li><a href="#_dockerfile_command_design_patterns">Dockerfile Command Design Patterns</a>
466+
<ul class="sectlevel3">
466467
<li><a href="#_difference_between_cmd_and_entrypoint">Difference between CMD and ENTRYPOINT</a></li>
467468
<li><a href="#_difference_between_add_and_copy">Difference between ADD and COPY</a></li>
469+
<li><a href="#_import_and_export_images">Import and export images</a></li>
468470
</ul>
469471
</li>
470-
<li><a href="#_import_and_export_images">Import and export images</a></li>
471472
</ul>
472473
</li>
473474
<li><a href="#_run_container">Run Container</a>
@@ -1288,7 +1289,7 @@ <h3 id="_dockerfile">Dockerfile</h3>
12881289
<div class="sect2">
12891290
<h3 id="_create_your_first_docker_image">Create your first Docker image</h3>
12901291
<div class="paragraph">
1291-
<p><em>Hello World</em> Dockerfile is shown:</p>
1292+
<p>Create a new text file <em>Dockerfile</em> in an empty directory and use the following contents:</p>
12921293
</div>
12931294
<div class="listingblock">
12941295
<div class="title">Hello World Dockerfile</div>
@@ -1367,10 +1368,11 @@ <h3 id="_create_your_first_docker_image">Create your first Docker image</h3>
13671368
busybox latest 3d5bcd78e074 4 days ago 1.113 MB</code></pre>
13681369
</div>
13691370
</div>
1370-
<div class="sect3">
1371-
<h4 id="_run_wildfly">Run WildFly</h4>
1371+
</div>
1372+
<div class="sect2">
1373+
<h3 id="_run_wildfly">Run WildFly</h3>
13721374
<div class="paragraph">
1373-
<p>Create a new text file <em>Dockerfile</em> in an empty directory:</p>
1375+
<p>Create a new text file <em>Dockerfile</em> in an empty directory and use the following contents:</p>
13741376
</div>
13751377
<div class="listingblock">
13761378
<div class="content">
@@ -1394,8 +1396,8 @@ <h4 id="_run_wildfly">Run WildFly</h4>
13941396
</div>
13951397
</div>
13961398
</div>
1397-
<div class="sect3">
1398-
<h4 id="_deploy_java_ee_7_application">Deploy Java EE 7 Application</h4>
1399+
<div class="sect2">
1400+
<h3 id="_deploy_java_ee_7_application">Deploy Java EE 7 Application</h3>
13991401
<div class="paragraph">
14001402
<p>Create a new text file <em>Dockerfile</em> in an empty directory:</p>
14011403
</div>
@@ -1423,6 +1425,8 @@ <h4 id="_deploy_java_ee_7_application">Deploy Java EE 7 Application</h4>
14231425
</div>
14241426
</div>
14251427
</div>
1428+
<div class="sect2">
1429+
<h3 id="_dockerfile_command_design_patterns">Dockerfile Command Design Patterns</h3>
14261430
<div class="sect3">
14271431
<h4 id="_difference_between_cmd_and_entrypoint">Difference between CMD and ENTRYPOINT</h4>
14281432
<div class="paragraph">
@@ -1476,9 +1480,8 @@ <h4 id="_difference_between_add_and_copy">Difference between ADD and COPY</h4>
14761480
</ol>
14771481
</div>
14781482
</div>
1479-
</div>
1480-
<div class="sect2">
1481-
<h3 id="_import_and_export_images">Import and export images</h3>
1483+
<div class="sect3">
1484+
<h4 id="_import_and_export_images">Import and export images</h4>
14821485
<div class="paragraph">
14831486
<p>Docker images can be saved using <code>save</code> command to a .tar file:</p>
14841487
</div>
@@ -1498,6 +1501,7 @@ <h3 id="_import_and_export_images">Import and export images</h3>
14981501
</div>
14991502
</div>
15001503
</div>
1504+
</div>
15011505
<div class="sect1">
15021506
<h2 id="_run_container">Run Container</h2>
15031507
<div class="sectionbody">

0 commit comments

Comments
 (0)