
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,481 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,411 Views
Hello,
I think it might help you.
With skopeo inspect, you can search for the keywork "usage":
skopeo inspect <URL> | grep usage
I hope it help you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,375 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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 5,314 Views
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:
Estrella Mountain Community College

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 4,791 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 3,562 Views
Hello @ChrisGR ,
A very good question !
The docker inspect command lets you see the environment variables for a Docker image.
An example command to display the MySQL Docker environment variables:
docker inspect --format='{{json .Config.Env}}' mysql:latest | python -m json.tool
Using the "json.tool" Python module, this command will output the environment variables in JSON format.
Replace mysql:latest with the name and tag of the Docker image you want to inspect.
Some Docker images don't define environment variables, and even if they do, they may not be necessary for the container to work.
Usually the Docker image or application documentation will tell you what environment variables are required and how to set them.