Now able to fetch variable by using find command in docker

docker exec -it wordpress env | find /i “mysql” FIND: Parameter format not correct
When i tried to fetch data of mysql from env, iam getting FIND parament is not correct

application is to create a database server:

docker rm -f (docker ps -qa)
$ docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=wordpress -e MYSQL_DATABASE=wordpress -e MYSQL_USER=wordpress -e MYSQL_PASSWORD=password mariadb

The next step is to run a WordPress container. In that command, we will link the wordpress container with the mariadb container:

$ docker run -d --name wordpress --link mariadb:mysql -p 8080:80 wordpress
Unable to find image ‘wordpress:latest’ locally
Trying to pull repository
latest: Pulling from

output truncated for brevity

Digest: sha256:670e4156377063df1a02f036354c52722de0348d46222ba30ef6a925c24cd46a

Let’s check container environments with the docker exec command:

$ docker exec -it wordpress env|grep -i mysql

output truncated for brevity

Finally, if your issue has not been addressed elsewhere, running:

  • :whale: :arrow_right: Settings :arrow_right: Diagnose & Feedback :arrow_right: Open Issues.

This forum is not an official product support or issue reporting channel.

It would be nice, if you change the post title from Now able to fetch variable by using find command in docker" to something more fitting… The find command is used to find files and folders, but not actualy find text in a output stream. Get all set environment and grepping it’s output in case insensitive is the right aproach.

Usualy I would say: never, ever use container ip’s directly. Though, it seems theses have been created from the mariadb container and thus hopefully, as a container ip will eventualy change, always points to the current container ip.