I'm going through the Deploy Containers guided exercise in chapter 11 and step 5 has you build a container image for python39.
I'm using the VM built to be used with netlabs so cannot be certain that this issue also exists on the RHA machines, but....
The instructions ask you to examine the container file in the python39 directory. This directory does not exist. Python36 directory exists but is does not contain the content indicated in the course material.
Based on the output shown in step 5.2, it appears the student is being asked to check some specific repos, download and install python3 then start the container as detached and having run the sleep inifinity command in one go. The yum install command is in the Containerfile but not the podman command run the container.
I created a dir called python39 and a Containerfile with the example content displayed
I was able to build the python39 container image but it did not automatically run that image.
If the student is expected to build the container then, as a separate step, start the container running, this is not in the text. If the student is expected to achieve all this based on the contents on the python39 Containerfile, the file is incomplete.
followup to the initial observation:
I added the following on a separate line to the Containerfile and achieved the same output shown in 5.2.
CMD ["/bin/bash", "-c", "sleep infinity"]
I rewrite most instructions. I have this note for this lab:
As of this writing (03NOV22), these instructions have been modified to work with the currently available lab images. (The instructions and start script refer to python36 while the repositories supply python39 and the Containerfile was completely rewritten.)
They will be replaced when Red Hat releases a proper set.
As it is now written, these instructions work correctly.
---------
And this is how I rewrote that step:
5. Build a container image called python36:1.0 from a Containerfile and use the image to create a container named python36
a. Change into the /home/student/python36/ directory and examine the container file called Containerfile
[student@servera ~]$ cd python36
[student@servera python36]$ cat Containerfile
Note: This is the old, incorrect, Containerfile
b. The existing Containerfile is from an old lab. Back it up and create a new one:
[student@servera python36]$ sudo cp -v Containerfile Containerfile.bak
[student@servera python36]$ sudo vim Containerfile
c. Here's the Containerfile in text. Note: There are three lines: A FROM line, the first RUN line (which is very long), and a second RUN line. Take care to type it in correctly.
FROM registry.lab.example.com/ubi9-beta/ubi:latest
RUN echo -e '[baseos]\nbaseurl = http://content.example.com/rhel9.0/x86_64/dvd/BaseOS\nenabled = true\ngpgcheck = false\nname = RHEL 9.0 BaseOS (dvd)\n[appstream]\nbaseurl = http://content.example.com/rhel9.0/x86_64/dvd/AppStream\nenabled = true\ngpgcheck = false\nname = RHEL 9.0 Appstream (dvd)'>/etc/yum.repos.d/rhel_dvd.repo
RUN dnf install --disablerepo=* --enablerepo=baseos --enablerepo=appstream -y python3
d. Build (create) the python36:1.0 container image from the container file. Don't forget the final dot (.).
[student@servera python36]$ podman build -t python36:1.0 .
. . . output omitted . . .
e. Return to the student user's home directory and verify that the python36:1.0 container image exists in the local image repository.
[student@servera python36]$ cd
[student@servera ~]$ podman images
f. Inspect the python36:1.0 image.
[student@servera ~]$ podman inspect localhost/python36:1.0
. . . output omitted . . .
g. Run a detached python36 container using the python36:1.0 image. Execute the sleep infinity command in the container.
[student@servera ~]$ podman run -d --name python36 python36:1.0 \
sleep infinity
h. Verify that the container is running.
[student@servera ~]$ podman ps
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.