cancel
Showing results for 
Search instead for 
Did you mean: 
spurs
Flight Engineer
Flight Engineer
  • 3,730 Views

Container image on the exam

Jump to solution

During the practice myself, I usually run the container image that was given from the questions.

Likewise, am I supposed to be given a specific container image from the question on the exam? 

If yes, just do 'podman run (whatever conf like port, name, bind-mounting) given imagename'?

Another question is that I know it's important to change ownership of directory when mounting container from hostdir to containerdir. For ex, /home/user/mysql:/var/lib/mysql:Z, in this case, the ownership of mysql dir must be appropriately configured. I used podman inspect imagename |grep User so that I can get UID GID. However, the UID of the above command will only show up once container is running. How can I get the proper UID for directory before running container?

Lastly, I'm wondering what exactly these port do in this command 'podman run -p 8080:80 ~~~~'

Thank you!

 

15 Replies
spurs
Flight Engineer
Flight Engineer
  • 1,842 Views

Alright! my bad.. thank you for the answer!

0 Kudos
spurs
Flight Engineer
Flight Engineer
  • 1,829 Views

spurs_0-1690811163788.png

 

First and second were redhat.io and access.com and showed errors.

Are these error occurred due to login status?

I tried docker.io registry at the end, and it showed uid gid as 0. Is this correct?

 

0 Kudos
spurs
Flight Engineer
Flight Engineer
  • 1,827 Views

podman image inspect mysql showed 999 UID and GID

Is this right?

spurs_0-1690811705069.png

 

0 Kudos
spurs
Flight Engineer
Flight Engineer
  • 3,574 Views

The error is that after I ran the container, I couldn't see the UID

spurs_0-1690764959954.png

 

Could anyone give a solution?

0 Kudos
tnishiok
Flight Engineer
Flight Engineer
  • 3,506 Views

Hi @spurs

I think the "User" field comes from either the "USER" instruction inside of Containerfile/Dockerfile or "podman run --user xxx" option. I guess you are using "docker.io/library/mariadb" then neigher of them will be applied. You may want to try the mariadb-105 image from Red Hat. That Containerfile has specified the USER instruction. 

USER 27

ENTRYPOINT ["container-entrypoint"]
CMD ["run-mysqld"]

Thereby the podman inspect command can retrieve the UID.

shell.jpg

Same for that RH mysql image. The "Get this image" tab will guide you how to pull the image.

0 Kudos
spurs
Flight Engineer
Flight Engineer
  • 1,812 Views

Hi tnishiok,

Thanks for the answer. I tried your instruction, but I still couldn't see UID (exec worked tho)

spurs_0-1690814077735.png

+Do I expect to get a Fully Qualified Imae Name during the exam? This is my concern

0 Kudos
Join the discussion
You must log in to join this conversation.