@@ -41,7 +41,7 @@ Table of Contents
4141
4242<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
4343
44- Fri Jul 12 02:57:12 UTC 2024
44+ Sat Sep 20 02:57:44 UTC 2025
4545
4646Learning Docker
4747================
@@ -83,7 +83,7 @@ To see if everything is working, try to obtain the Docker version.
8383docker --version
8484```
8585
86- ## Docker version 26.1.3 , build b72abbb
86+ ## Docker version 28.0.4 , build b8034c0
8787
8888And run the ` hello-world ` image. (The ` --rm ` parameter is used to
8989automatically remove the container when it exits.)
@@ -94,11 +94,10 @@ docker run --rm hello-world
9494
9595 ## Unable to find image 'hello-world:latest' locally
9696 ## latest: Pulling from library/hello-world
97- ## c1ec31eb5944: Pulling fs layer
98- ## c1ec31eb5944: Verifying Checksum
99- ## c1ec31eb5944: Download complete
100- ## c1ec31eb5944: Pull complete
101- ## Digest: sha256:1408fec50309afee38f3535383f5b09419e6dc0925bc69891e79d84cc4cdcec6
97+ ## 17eec7bbc9d7: Pulling fs layer
98+ ## 17eec7bbc9d7: Download complete
99+ ## 17eec7bbc9d7: Pull complete
100+ ## Digest: sha256:54e66cc1dd1fcb1c3c58bd8017914dbed8701e2d8c74d9262e26bd9cc1642d31
102101 ## Status: Downloaded newer image for hello-world:latest
103102 ##
104103 ## Hello from Docker!
@@ -131,29 +130,29 @@ docker version
131130```
132131
133132 ## Client: Docker Engine - Community
134- ## Version: 26.1.3
135- ## API version: 1.45
136- ## Go version: go1.21.10
137- ## Git commit: b72abbb
138- ## Built: Thu May 16 08:33:29 2024
133+ ## Version: 28.0.4
134+ ## API version: 1.48
135+ ## Go version: go1.23.7
136+ ## Git commit: b8034c0
137+ ## Built: Tue Mar 25 15:07:16 2025
139138 ## OS/Arch: linux/amd64
140139 ## Context: default
141140 ##
142141 ## Server: Docker Engine - Community
143142 ## Engine:
144- ## Version: 26.1.3
145- ## API version: 1.45 (minimum version 1.24)
146- ## Go version: go1.21.10
147- ## Git commit: 8e96db1
148- ## Built: Thu May 16 08:33:29 2024
143+ ## Version: 28.0.4
144+ ## API version: 1.48 (minimum version 1.24)
145+ ## Go version: go1.23.7
146+ ## Git commit: 6430e49
147+ ## Built: Tue Mar 25 15:07:16 2025
149148 ## OS/Arch: linux/amd64
150149 ## Experimental: false
151150 ## containerd:
152- ## Version: 1.7.18
153- ## GitCommit: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
151+ ## Version: 1.7.27
152+ ## GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
154153 ## runc:
155- ## Version: 1.7.18
156- ## GitCommit: v1.1.13 -0-g58aa920
154+ ## Version: 1.2.5
155+ ## GitCommit: v1.2.5 -0-g59923ef
157156 ## docker-init:
158157 ## Version: 0.19.0
159158 ## GitCommit: de40ad0
@@ -165,32 +164,32 @@ docker info
165164```
166165
167166 ## Client: Docker Engine - Community
168- ## Version: 26.1.3
167+ ## Version: 28.0.4
169168 ## Context: default
170169 ## Debug Mode: false
171170 ## Plugins:
172171 ## buildx: Docker Buildx (Docker Inc.)
173- ## Version: v0.15.1
172+ ## Version: v0.28.0
174173 ## Path: /usr/libexec/docker/cli-plugins/docker-buildx
175174 ## compose: Docker Compose (Docker Inc.)
176- ## Version: v2.27.1
175+ ## Version: v2.38.2
177176 ## Path: /usr/libexec/docker/cli-plugins/docker-compose
178177 ##
179178 ## Server:
180179 ## Containers: 0
181180 ## Running: 0
182181 ## Paused: 0
183182 ## Stopped: 0
184- ## Images: 16
185- ## Server Version: 26.1.3
183+ ## Images: 1
184+ ## Server Version: 28.0.4
186185 ## Storage Driver: overlay2
187186 ## Backing Filesystem: extfs
188187 ## Supports d_type: true
189188 ## Using metacopy: false
190189 ## Native Overlay Diff: false
191190 ## userxattr: false
192191 ## Logging Driver: json-file
193- ## Cgroup Driver: cgroupfs
192+ ## Cgroup Driver: systemd
194193 ## Cgroup Version: 2
195194 ## Plugins:
196195 ## Volume: local
@@ -200,27 +199,28 @@ docker info
200199 ## Runtimes: io.containerd.runc.v2 runc
201200 ## Default Runtime: runc
202201 ## Init Binary: docker-init
203- ## containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
204- ## runc version: v1.1.13 -0-g58aa920
202+ ## containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
203+ ## runc version: v1.2.5 -0-g59923ef
205204 ## init version: de40ad0
206205 ## Security Options:
207206 ## apparmor
208207 ## seccomp
209208 ## Profile: builtin
210209 ## cgroupns
211- ## Kernel Version: 6.5 .0-1023 -azure
212- ## Operating System: Ubuntu 22 .04.4 LTS
210+ ## Kernel Version: 6.11 .0-1018 -azure
211+ ## Operating System: Ubuntu 24 .04.3 LTS
213212 ## OSType: linux
214213 ## Architecture: x86_64
215214 ## CPUs: 4
216- ## Total Memory: 15.61GiB
217- ## Name: fv-az1393-226
218- ## ID: e47e7669-35e6-4532-94ca-a2b577895d60
215+ ## Total Memory: 15.62GiB
216+ ## Name: runnervmf4ws1
217+ ## ID: 80b0c887-f378-498c-94b8-5e260688697c
219218 ## Docker Root Dir: /var/lib/docker
220219 ## Debug Mode: false
221220 ## Username: githubactions
222221 ## Experimental: false
223222 ## Insecure Registries:
223+ ## ::1/128
224224 ## 127.0.0.0/8
225225 ## Live Restore Enabled: false
226226
@@ -540,15 +540,14 @@ docker run --rm davetang/bwa:0.7.17
540540 ## 5f22362f8660: Pulling fs layer
541541 ## 3836f06c7ac7: Pulling fs layer
542542 ## 3836f06c7ac7: Waiting
543- ## 5f22362f8660: Verifying Checksum
544- ## 5f22362f8660: Download complete
545543 ## feac53061382: Verifying Checksum
546544 ## feac53061382: Download complete
547- ## 3836f06c7ac7: Verifying Checksum
545+ ## 5f22362f8660: Verifying Checksum
546+ ## 5f22362f8660: Download complete
548547 ## 3836f06c7ac7: Download complete
548+ ## feac53061382: Pull complete
549549 ## 549f86662946: Verifying Checksum
550550 ## 549f86662946: Download complete
551- ## feac53061382: Pull complete
552551 ## 549f86662946: Pull complete
553552 ## 5f22362f8660: Pull complete
554553 ## 3836f06c7ac7: Pull complete
@@ -592,14 +591,13 @@ docker run --rm --env YEAR=1984 busybox env
592591
593592 ## Unable to find image 'busybox:latest' locally
594593 ## latest: Pulling from library/busybox
595- ## ec562eabd705: Pulling fs layer
596- ## ec562eabd705: Verifying Checksum
597- ## ec562eabd705: Download complete
598- ## ec562eabd705: Pull complete
599- ## Digest: sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
594+ ## 80bfbb8a41a2: Pulling fs layer
595+ ## 80bfbb8a41a2: Download complete
596+ ## 80bfbb8a41a2: Pull complete
597+ ## Digest: sha256:d82f458899c9696cb26a7c02d5568f81c8c8223f8661bb2a7988b269c8b9051e
600598 ## Status: Downloaded newer image for busybox:latest
601599 ## PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
602- ## HOSTNAME=6756bfb21218
600+ ## HOSTNAME=b103f016ad65
603601 ## YEAR=1984
604602 ## HOME=/root
605603
@@ -610,7 +608,7 @@ docker run --rm --env YEAR=1984 --env SEED=2049 busybox env
610608```
611609
612610 ## PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
613- ## HOSTNAME=63e709574457
611+ ## HOSTNAME=b86b07e2422d
614612 ## YEAR=1984
615613 ## SEED=2049
616614 ## HOME=/root
@@ -622,7 +620,7 @@ docker run --rm -e YEAR=1984 -e SEED=2049 busybox env
622620```
623621
624622 ## PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
625- ## HOSTNAME=1ddc0f93c2d8
623+ ## HOSTNAME=5aa9f04852ef
626624 ## YEAR=1984
627625 ## SEED=2049
628626 ## HOME=/root
@@ -735,15 +733,15 @@ for `data/chrI.fa.gz`.
735733docker run --rm -v $( pwd) /data:/work davetang/bwa:0.7.17 bwa index chrI.fa.gz
736734```
737735
738- ## [bwa_index] Pack FASTA... 0.15 sec
736+ ## [bwa_index] Pack FASTA... 0.14 sec
739737 ## [bwa_index] Construct BWT for the packed sequence...
740- ## [bwa_index] 3.47 seconds elapse.
741- ## [bwa_index] Update BWT... 0.07 sec
738+ ## [bwa_index] 3.25 seconds elapse.
739+ ## [bwa_index] Update BWT... 0.06 sec
742740 ## [bwa_index] Pack forward-only FASTA... 0.11 sec
743- ## [bwa_index] Construct SA from BWT and Occ... 1.28 sec
741+ ## [bwa_index] Construct SA from BWT and Occ... 0.95 sec
744742 ## [main] Version: 0.7.17-r1188
745743 ## [main] CMD: bwa index chrI.fa.gz
746- ## [main] Real time: 5.121 sec; CPU: 5.093 sec
744+ ## [main] Real time: 4.530 sec; CPU: 4.538 sec
747745
748746We can see the newly created index files.
749747
@@ -752,13 +750,13 @@ ls -lrt data
752750```
753751
754752 ## total 30436
755- ## -rw-r--r-- 1 runner docker 194 Jul 12 02:52 README.md
756- ## -rw-r--r-- 1 runner docker 4772981 Jul 12 02:52 chrI.fa.gz
757- ## -rw-r--r-- 1 root root 15072516 Jul 12 02:56 chrI.fa.gz.bwt
758- ## -rw-r--r-- 1 root root 3768110 Jul 12 02:56 chrI.fa.gz.pac
759- ## -rw-r--r-- 1 root root 41 Jul 12 02:56 chrI.fa.gz.ann
760- ## -rw-r--r-- 1 root root 13 Jul 12 02:56 chrI.fa.gz.amb
761- ## -rw-r--r-- 1 root root 7536272 Jul 12 02:56 chrI.fa.gz.sa
753+ ## -rw-r--r-- 1 runner runner 194 Sep 20 02:51 README.md
754+ ## -rw-r--r-- 1 runner runner 4772981 Sep 20 02:51 chrI.fa.gz
755+ ## -rw-r--r-- 1 root root 15072516 Sep 20 02:57 chrI.fa.gz.bwt
756+ ## -rw-r--r-- 1 root root 3768110 Sep 20 02:57 chrI.fa.gz.pac
757+ ## -rw-r--r-- 1 root root 41 Sep 20 02:57 chrI.fa.gz.ann
758+ ## -rw-r--r-- 1 root root 13 Sep 20 02:57 chrI.fa.gz.amb
759+ ## -rw-r--r-- 1 root root 7536272 Sep 20 02:57 chrI.fa.gz.sa
762760
763761However note that the generated files are owned by ` root ` , which is
764762slightly annoying because unless we have root access, we need to start a
@@ -885,7 +883,7 @@ ls -lrt $(pwd)/test_root.txt
885883 ## 3ad6ea492c35: Pull complete
886884 ## Digest: sha256:e322f4808315c387868a9135beeb11435b5b83130a8599fd7d0014452c34f489
887885 ## Status: Downloaded newer image for ubuntu:22.10
888- ## -rw-r--r-- 1 root root 0 Jul 12 02:56 /home/runner/work/learning_docker/learning_docker/test_root.txt
886+ ## -rw-r--r-- 1 root root 0 Sep 20 02:57 /home/runner/work/learning_docker/learning_docker/test_root.txt
889887
890888In this example, we run the command as a user with the same UID and GID;
891889the ` stat ` command is used to get the UID and GID.
@@ -895,7 +893,7 @@ docker run -v $(pwd):/$(pwd) -u $(stat -c "%u:%g" $HOME) ubuntu:22.10 touch $(pw
895893ls -lrt $( pwd) /test_mine.txt
896894```
897895
898- ## -rw-r--r-- 1 runner docker 0 Jul 12 02:56 /home/runner/work/learning_docker/learning_docker/test_mine.txt
896+ ## -rw-r--r-- 1 runner runner 0 Sep 20 02:57 /home/runner/work/learning_docker/learning_docker/test_mine.txt
899897
900898One issue with this method is that you may encounter the following
901899warning (if running interactively):
@@ -932,7 +930,7 @@ docker pull busybox
932930
933931 ## Using default tag: latest
934932 ## latest: Pulling from library/busybox
935- ## Digest: sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
933+ ## Digest: sha256:d82f458899c9696cb26a7c02d5568f81c8c8223f8661bb2a7988b269c8b9051e
936934 ## Status: Image is up to date for busybox:latest
937935 ## docker.io/library/busybox:latest
938936
@@ -943,7 +941,7 @@ docker images busybox
943941```
944942
945943 ## REPOSITORY TAG IMAGE ID CREATED SIZE
946- ## busybox latest 65ad0d468eb1 14 months ago 4.26MB
944+ ## busybox latest 0ed463b26dae 11 months ago 4.43MB
947945
948946Remove ` busybox ` .
949947
@@ -952,9 +950,9 @@ docker rmi busybox
952950```
953951
954952 ## Untagged: busybox:latest
955- ## Untagged: busybox@sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
956- ## Deleted: sha256:65ad0d468eb1c558bf7f4e64e790f586e9eda649ee9f130cd0e835b292bbc5ac
957- ## Deleted: sha256:d51af96cf93e225825efd484ea457f867cb2b967f7415b9a3b7e65a2f803838a
953+ ## Untagged: busybox@sha256:d82f458899c9696cb26a7c02d5568f81c8c8223f8661bb2a7988b269c8b9051e
954+ ## Deleted: sha256:0ed463b26daee791b094dc3fff25edb3e79f153d37d274e5c2936923c38dac2b
955+ ## Deleted: sha256:80e840de630d08a6a1e0ee30e7c8378cf1ed6a424315d7e437f54780aee6bf5a
958956
959957## Committing changes
960958
@@ -1030,10 +1028,10 @@ Show all containers.
10301028docker ps -a
10311029```
10321030
1033- ## CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1034- ## 58063b585386 hello-world "/hello" 1 second ago Exited (0) Less than a second ago compassionate_banach
1035- ## 89d682575b32 ubuntu:22.10 "touch /home/runner/…" 2 seconds ago Exited (0) 1 second ago gallant_stonebraker
1036- ## ca3de985b5b0 ubuntu:22.10 "touch /home/runner/…" 3 seconds ago Exited (0) 2 seconds ago naughty_raman
1031+ ## CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1032+ ## ad67e22d1167 hello-world "/hello" Less than a second ago Exited (0) Less than a second ago vigilant_panini
1033+ ## 65f0704bff8e ubuntu:22.10 "touch /home/runner/…" 2 seconds ago Exited (0) 1 second ago naughty_bhaskara
1034+ ## 25d371e800b0 ubuntu:22.10 "touch /home/runner/…" 2 seconds ago Exited (0) 1 second ago gracious_boyd
10371035
10381036We can use a sub-shell to get all (` -a ` ) container IDs (` -q ` ) that have
10391037exited (` -f status=exited ` ) and then remove them (` docker rm -v ` ).
@@ -1042,9 +1040,9 @@ exited (`-f status=exited`) and then remove them (`docker rm -v`).
10421040docker rm -v $( docker ps -a -q -f status=exited)
10431041```
10441042
1045- ## 58063b585386
1046- ## 89d682575b32
1047- ## ca3de985b5b0
1043+ ## ad67e22d1167
1044+ ## 65f0704bff8e
1045+ ## 25d371e800b0
10481046
10491047Check to see if the container still exists.
10501048
@@ -1164,16 +1162,14 @@ docker run --rm rocker/r-ver:4.3.0
11641162 ## e7191ae70de7: Pulling fs layer
11651163 ## d6f516f66899: Waiting
11661164 ## e7191ae70de7: Waiting
1167- ## eb5ba85ece65: Verifying Checksum
11681165 ## eb5ba85ece65: Download complete
11691166 ## d6f516f66899: Verifying Checksum
11701167 ## d6f516f66899: Download complete
11711168 ## 3c645031de29: Verifying Checksum
11721169 ## 3c645031de29: Download complete
1173- ## e7191ae70de7: Verifying Checksum
1174- ## e7191ae70de7: Download complete
11751170 ## 3c645031de29: Pull complete
11761171 ## eb5ba85ece65: Pull complete
1172+ ## e7191ae70de7: Download complete
11771173 ## 336082e130a7: Verifying Checksum
11781174 ## 336082e130a7: Download complete
11791175 ## 336082e130a7: Pull complete
0 commit comments