0

I am unable to get all the env variables even after the docker inspect <container_id> command it just shows only this much when I inspected the mongo:4 image.

                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.17",
                "JSYAML_VERSION=3.13.1",
                "MONGO_PACKAGE=mongodb-org",
                "MONGO_REPO=repo.mongodb.org",
                "MONGO_MAJOR=4.4",
                "MONGO_VERSION=4.4.29",
                "HOME=/data/db"],```
so how to get all the env variables available for the particular image? 

1 Answers1

1

@goulashsoup has good advice... so, if you mean, how to inspect environment variables in a running container, then do:

docker exec -u root $CONTAINER_ID sh -c "env | sort"
mikequentel
  • 618
  • 4
  • 9