CKAD · Question #27
Context: No configuration context change is required for this task. Task: A Dockerfile has been prepared at ~/human-stork/Dockerfile 1) Using the prepared Dockerfile, build a container image with…
Solution: candidate@node-1:~$ ls -l ~/human-stork/builds total 4 -rw-r--r-- 1 candidate candidate 201 Sep 24 04:21 Dockerfile candidate@node-1:~$ ls -l /usr/share/nginx/html/ total 24 -rw-r--r-- 1 candidate candidate 813 Sep 24 04:21 text2.html -rw-r--r-- 1 candidate candidate…
Question
- Using the prepared Dockerfile, build a container image with the name macque and tag 3.0. You may install and use the tool of your choice.
- Using the tool of your choice export the built container image in OC-format and store it at - /human stork/macque 3.0 tar
Exhibits
Explanation
Solution:
candidate@node-1:$ ls -l $ podman build -t macque:3.0 -f /human-stork/builds
total 4
-rw-r--r-- 1 candidate candidate 201 Sep 24 04:21 Dockerfile
candidate@node-1:$ ls -l /usr/share/nginx/html/
total 24
-rw-r--r-- 1 candidate candidate 813 Sep 24 04:21 text2.html
-rw-r--r-- 1 candidate candidate 4583 Sep 24 04:21 text1.html
candidate@node-1:/human-stork/builds/Dockerfile
STEP 1/2: FROM nginx
STEP 2/2: COPY text2.html /usr/share/nginx/html/
COMMIT
--> 331e9a8372cb
Successfully built 331e9a8372cb
Successfully tagged macque:3.0
candidate@node-1:$ podman images | grep macque
localhost/macque 3.0 331e9a8372cb About a minute ago 178 MB
candidate@node-1:~$ podman save -o /human-stork/macque-3.0.tar localhost/macque:3.0
Getting image source signatures
Copying blob sha256:d6c4d8cefd54b52467d5e49e09d1e3d3090740924ec172e293a971c26b8627e7
Copying blob sha256:4ae04e43e71db6b96e4e897a9f81665e71869e9d997f742332679c11867b938f
Copying blob sha256:d007e0ea90df11100f91a92e1b12239f67b54a2a1b94d805844ff95b95c378e9
Copying blob sha256:29a82894a480d19f8602b9e73d31295328249820f1b4028c2c07921a48c3f761
Copying blob sha256:5d52a781b4f4c7811231a54b35e38a2e7208d27a988d579601d32a4e2e2831e5
Copying blob sha256:77319c72e25d4872c019d1112b2e53c482c3c6e935272a76f2382ce4365319a2
Copying blob sha256:8c9e5033c5e8557ee0f33d7b43f9a94156641e7d0d0f7b243b87d81a95a81831
Copying blob sha256:4585542a15c8225585090f48f4306cf2273187a5f3e439564f33198f123f1854
Copying blob sha256:331e9a8372cb04b3531b7829705b68d6693a1290e29b110b66b443015b63013d
Writing manifest to image destination
Storing signatures
candidate@node-1:$ ls -l /human-stork/
total 142532
-rw-rw-r-- 1 candidate candidate 145948072 Sep 24 04:21 macque-3.0.tar
candidate@node-1:$
Topics
Community Discussion
No community discussion yet for this question.

