Can I find Dockerfile format structure (keywords, examples, etc) in a standalone RHEL OS installation? So that during a certification test I could lookup the format if I forget something. I know many OS commands have stuff like "man 5 command" to get their config file structure details, but I cannot seem to find anything like that for a Dockerfile or Containerfile
This is valid for any type of file you might need, so take your peek :)
# yum provides "**/Dockerfile"
# yum install buildah-tests (for example)
AFAIK RHEL8 man pages provide no example and no explanation of the syntax of Dockerfile, just like RHEL8 gcc package provides no tutorial on the C programming language.
But you can find a few examples of Dockerfiles and recommended practices in the "Building, running, and managing containers" guide from RHEL8 at
I come back to this post about a year later, and there are so many additional great suggestions on this Q. Thanks so much for sharing!
This is valid for any type of file you might need, so take your peek :)
# yum provides "**/Dockerfile"
# yum install buildah-tests (for example)
Thanks @Fran_Garcia !!! That is exactly the kind of info I needed. Never really thought to globally search the repositories for example files. That'll help a lot in case I forget a keyword or syntax in a closed-off cert test lab environment
AFAIK RHEL8 man pages provide no example and no explanation of the syntax of Dockerfile, just like RHEL8 gcc package provides no tutorial on the C programming language.
But you can find a few examples of Dockerfiles and recommended practices in the "Building, running, and managing containers" guide from RHEL8 at
Hi,
As @Ken_McDonald highlighted in the OP, it's also "during a certification test".
About the 2 alleged solutions, I hope we can find something else...
1) Looking up any existing Dockerfile might work, it's time consuming and many files don't have the exact syntax as example. Let's say that during an official test, it took me easily 10-15 minutes (which was 12%-18% of the total exam time) to find some example remotely relevant. And now, comparing with results found in the internet in approximately 1 minutes, I probably got the syntax wrong. That's even stranger because I tried two versions during the exam (wasting additional precious time) and the one I selected was able to "start a process", as proven by podman logs.
2) The second one required to install "buildah-tests ", which might or might not have any example files. Beside finding some Dockerfile files, I have no indication what to look for, possibly having to browse through several files again. Also, the size is rather consequent with the dependencies: Installed size: 576 M.... Having to install many packages + consequent amount of data for what could be a single man page or example file seems way over the top. At least on operational level and/or real world conditions.
Unfortunately, the online page quoted above, does not contain the type of CMD related example one would need (to complete a specific given task during an exam):
I will keep looking for an alternative solution.
man -k dockerfile
leads to:
Dockerfile(5)
which shows all the possible syntax.
If Dockerfile(5) man pages are not installed, you can check what to install with:
yum provides "*man?/Dockerfile*"
Also, the provided RHEL8 Documentation link shows CMD examples eg in "6.5. BUILDING AN UBI-BASED IMAGE".
(In an RHexam, try to open Docs as pdf with evince. This leads to better performance and enables you to search the whole Doc)
Also the "s2i" (source-to-image from rhel-server-rhscl-7-rpms) tool might help A LOT.
Just invoke it like:
s2i create name dir
and you should have a perfect ocp-style dockerfile in ./dir/Dockerfile
I come back to this post about a year later, and there are so many additional great suggestions on this Q. Thanks so much for sharing!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.