Ken_McDonald
Mission Specialist
Mission Specialist
  • 435 Views

Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

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

1 Solution

Accepted Solutions
Fran_Garcia
Flight Engineer Flight Engineer
Flight Engineer
  • 414 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

This is valid for any type of file you might need, so take your peek Smiley Happy

 

# yum provides "**/Dockerfile"

# yum install buildah-tests  (for example)

 

View solution in original post

Reply
Loading...
6 Replies
Fran_Garcia
Flight Engineer Flight Engineer
Flight Engineer
  • 415 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

This is valid for any type of file you might need, so take your peek Smiley Happy

 

# yum provides "**/Dockerfile"

# yum install buildah-tests  (for example)

 

View solution in original post

Reply
Loading...
Ken_McDonald
Mission Specialist
Mission Specialist
  • 392 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

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

0 Kudos
Reply
Loading...
flozano
Moderator
Moderator
  • 402 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

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

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_runnin...

Reply
Loading...
JS_Learning
Moderator
Moderator
  • 169 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

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): 

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_runnin... 

 

I will keep looking for an alternative solution.

 

 

Reply
Loading...
tat
Mission Specialist
Mission Specialist
  • 21 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to 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)

 

 

Reply
Loading...
tat
Mission Specialist
Mission Specialist
  • 13 Views

Re: Is there Dockerfile format or example in RHEL man page or elsewhere in an OS install?

Jump to solution

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

Reply
Loading...
Join the discussion
You must log in to join this conversation.