ChrisGR
Mission Specialist
Mission Specialist
  • 952 Views

Podman search - Environmental variables

Hello all,

Let's say that we want to create a container that needs be fed with environmental variables when started (such as mysql). How we are going to know beforehand the environment variables using ONLY the CLI?

podman inspect or skopeo inspect do not provide detailed info on the env. vars that are available for a specific image.

Regards,

Chris

Labels (3)
4 Replies
EmanuelHaine
Flight Engineer
Flight Engineer
  • 882 Views

Hello,

I think it might help you.

With skopeo inspect, you can search for the keywork "usage":

skopeo inspect <URL> | grep usage

Screenshot from 2022-02-23 22-01-41.png

I hope it help you!

ChrisGR
Mission Specialist
Mission Specialist
  • 846 Views

Hello Emanuel,

Thanks a lot! But it seems that usage states only an example, and not the whole list of the environmental variables supported by the image.

Regards,

Chris

Tracy_Baker
Starfighter Starfighter
Starfighter
  • 785 Views

@ChrisGR 

If you do a podman run and don't specify environment variables, you might get what you want. This method may not work for everthing. For mariadb, it returns this:

1.JPG

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
MarkosS
Flight Engineer
Flight Engineer
  • 262 Views

I do try the previous answers but sometimes no info is visible in skopeo or when starting the container.

As a workaround I also try openshift: If a template is available it can provide the list of env parameters oc new-app (oc process templatename --parameters). Of course this works only if there is an available template... 
I haven't found a generic solution to to this 

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