We have seen how to give containers parameters or environment variables when starting the official MySQL container:
docker run --name mysql-one -e MYSQL_ROOT_PASSWORD=pw -d mysql
–e MYSQL_ROOT_PASSWORD=pw command is an example showing how you can do it. It means that the
MYSQL_ROOT_PASSWORD environment variable inside the container has
pw as the value.
This is a very convenient way to have configurable containers where you can have a setup script as
ENTRYPOINT or a foreground script configuring passwords; hosts; test, staging, or production environments; and other settings that the container needs.