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
Seeing a [container](./what-is-a-container) is an isolated process, where does it get its files and configuration? How do you share those environments?
14
+
Seeing a [container](./what-is-a-container.md) is an isolated process, where does it get its files and configuration? How do you share those environments?
15
15
16
-
That's where container images come in!
17
-
18
-
A container image is a standardized package that includes all of the files, binaries, libraries, and configurations to run a container.
16
+
That's where container images come in. A container image is a standardized package that includes all of the files, binaries, libraries, and configurations to run a container.
19
17
20
18
For a [PostgreSQL](https://hub.docker.com/_/postgres) image, that image will package the database binaries, config files, and other dependencies. For a Python web app, it'll include the Python runtime, your app code, and all of its dependencies.
21
19
22
20
There are two important principles of images:
23
21
24
22
1. Images are immutable. Once an image is created, it can't be modified. You can only make a new image or add changes on top of it.
25
23
26
-
2. Container images are composed of layers. Each layer represented a set of file system changes that add, remove, or modify files.
24
+
2. Container images are composed of layers. Each layer represents a set of file system changes that add, remove, or modify files.
27
25
28
26
These two principles let you to extend or add to existing images. For example, if you are building a Python app, you can start from the [Python image](https://hub.docker.com/_/python) and add additional layers to install your app's dependencies and add your code. This lets you focus on your app, rather than Python itself.
29
27
@@ -50,19 +48,18 @@ In this hands-on, you will learn how to search and pull a container image using
50
48
51
49
1. Open the Docker Desktop Dashboard and select the **Images** view in the left-hand navigation menu.
52
50
53
-

51
+

54
52
55
53
2. Select the **Search images to run** button. If you don't see it, select the _global search bar_ at the top of the screen.
56
54
57
-

55
+

58
56
59
57
3. In the **Search** field, enter "welcome-to-docker". Once the search has completed, select the `docker/welcome-to-docker` image.
60
58
61
-

59
+

62
60
63
61
4. Select **Pull** to download the image.
64
62
65
-
66
63
### Learn about the image
67
64
68
65
Once you have an image downloaded, you can learn quite a few details about the image either through the GUI or the CLI.
@@ -71,13 +68,11 @@ Once you have an image downloaded, you can learn quite a few details about the i
71
68
72
69
2. Select the **docker/welcome-to-docker** image to open details about the image.
73
70
74
-

71
+

75
72
76
73
3. The image details page presents you with information regarding the layers of the image, the packages and libraries installed in the image, and any discovered vulnerabilities.
77
74
78
-

79
-
80
-
75
+

81
76
82
77
{{< /tab >}}
83
78
@@ -87,103 +82,101 @@ Follow the instructions to search and pull a Docker image using CLI to view its
87
82
88
83
### Search for and download an image
89
84
90
-
1. Open a terminal and search for images using the [`docker search`](/reference/cli/docker/search/) command:
91
-
92
-
```console
93
-
docker search docker/welcome-to-docker
94
-
```
85
+
1. Open a terminal and search for images using the [`docker search`](/reference/cli/docker/search.md) command:
95
86
96
-
You will see output like the following:
87
+
```console
88
+
docker search docker/welcome-to-docker
89
+
```
97
90
98
-
```console
99
-
NAME DESCRIPTION STARS OFFICIAL
100
-
docker/welcome-to-docker Docker image for new users getting started w… 20
101
-
```
91
+
You will see output like the following:
102
92
103
-
This output shows you information about relevant images available on Docker Hub.
93
+
```console
94
+
NAME DESCRIPTION STARS OFFICIAL
95
+
docker/welcome-to-docker Docker image for new users getting started w… 20
96
+
```
104
97
105
-
2. Pull the image using the [`docker pull`](/reference/cli/docker/image/pull/) command.
98
+
This output shows you information about relevant images available on Docker Hub.
106
99
107
-
```console
108
-
docker pull docker/welcome-to-docker
109
-
```
100
+
2. Pull the image using the [`docker pull`](/reference/cli/docker/image/pull.md) command.
Status: Downloaded newer image for docker/welcome-to-docker:latest
126
-
docker.io/docker/welcome-to-docker:latest
127
-
```
106
+
You will see output like the following:
128
107
129
-
Each of line represents a different downloaded layer of the image. Remember that each layer is a set of filesystem changes and provides functionality of the image.
Status: Downloaded newer image for docker/welcome-to-docker:latest
121
+
docker.io/docker/welcome-to-docker:latest
122
+
```
130
123
124
+
Each of line represents a different downloaded layer of the image. Remember that each layer is a set of filesystem changes and provides functionality of the image.
131
125
132
126
### Learn about the image
133
127
134
-
1. List your downloaded images using the [`docker image ls`](/reference/cli/docker/image/ls/) command:
135
-
136
-
```console
137
-
docker image ls
138
-
```
128
+
1. List your downloaded images using the [`docker image ls`](/reference/cli/docker/image/ls.md) command:
139
129
140
-
You will see output like the following:
130
+
```console
131
+
docker image ls
132
+
```
141
133
142
-
```console
143
-
REPOSITORY TAG IMAGE ID CREATED SIZE
144
-
docker/welcome-to-docker latest eedaff45e3c7 4 months ago 29.7MB
145
-
```
134
+
You will see output like the following:
146
135
147
-
The command shows a list of Docker images currently available on your system. The `docker/welcome-to-docker` has a total size of approximately 29.7MB.
136
+
```console
137
+
REPOSITORY TAG IMAGE ID CREATED SIZE
138
+
docker/welcome-to-docker latest eedaff45e3c7 4 months ago 29.7MB
139
+
```
148
140
149
-
> **Image size**
150
-
>
151
-
> The image size represented here reflects the uncompressed size of the image, not the download size of the layers.
141
+
The command shows a list of Docker images currently available on your system. The `docker/welcome-to-docker` has a total size of approximately 29.7MB.
152
142
153
-
2. List the image's layers using the [`docker image history`](/reference/cli/docker/image/history/) command:
143
+
> **Image size**
144
+
>
145
+
> The image size represented here reflects the uncompressed size of the image, not the download size of the layers.
154
146
155
-
```console
156
-
docker image history docker/welcome-to-docker
157
-
```
147
+
2. List the image's layers using the [`docker image history`](/reference/cli/docker/image/history.md) command:
<missing> 5 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
172
+
<missing> 5 months ago /bin/sh -c #(nop) ADD file:ff3112828967e8004… 7.66MB
173
+
```
182
174
183
-
> **Viewing the full command**
184
-
>
185
-
> If you add the `--no-trunc` flag to the command, you will see the full command. Note that, since the output is in a table-like format, longer commands will cause the output to be very difficult to navigate.
175
+
This output shows you all of the layers, their sizes, and the command used to create the layer.
186
176
177
+
> **Viewing the full command**
178
+
>
179
+
> If you add the `--no-trunc` flag to the command, you will see the full command. Note that, since the output is in a table-like format, longer commands will cause the output to be very difficult to navigate.
187
180
188
181
{{< /tab >}}
189
182
{{< /tabs >}}
@@ -194,12 +187,12 @@ In this walkthrough, you searched and pulled a Docker image. In addition to pull
194
187
195
188
The following resources will help you learn more about exploring, finding, and building images:
196
189
197
-
- [Docker Trusted Content](/trusted-content/)
198
-
- [Docker Official Images docs](/trusted-content/official-images/)
0 commit comments