You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/docker-image.adoc
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ _Dockerfile_ is usually called _Dockerfile_. The complete list of commands that
26
26
27
27
=== Create your first Docker image
28
28
29
-
_Hello World_ Dockerfile is shown:
29
+
Create a new text file _Dockerfile_ in an empty directory and use the following contents:
30
30
31
31
.Hello World Dockerfile
32
32
[source, text]
@@ -90,9 +90,9 @@ ubuntu latest a5a467fddcb8 2 days ago
90
90
busybox latest 3d5bcd78e074 4 days ago 1.113 MB
91
91
----
92
92
93
-
==== Run WildFly
93
+
=== Run WildFly
94
94
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:
96
96
97
97
[source, text]
98
98
----
@@ -107,7 +107,7 @@ Run the container:
107
107
108
108
docker run -it mywildfly
109
109
110
-
==== Deploy Java EE 7 Application
110
+
=== Deploy Java EE 7 Application
111
111
112
112
Create a new text file _Dockerfile_ in an empty directory:
113
113
@@ -129,6 +129,8 @@ Build the image:
129
129
130
130
docker build -t movieplex .
131
131
132
+
=== Dockerfile Command Design Patterns
133
+
132
134
==== Difference between CMD and ENTRYPOINT
133
135
134
136
*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
166
168
. Allows tar file auto-extraction in the image, for example, `ADD app.tar.gz /opt/var/myapp`.
167
169
. 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.
168
170
169
-
=== Import and export images
171
+
==== Import and export images
170
172
171
173
Docker images can be saved using `save` command to a .tar file:
0 commit comments