In my projects Docker file I have some environment variables, like this:
ENV ACCEPT_EULA=Y
ENV SA_PASSWORD=Password
ENV MSSQL_PID=Developer
ENV MSSQL_TCP_PORT=1433
And I would like to pass the password here as an environment variable set in my pipeline.
In Azure DevOps I have two pipelines. One for building the solution and one for building and pushing docker images to DockerHub. There are options to set variables in both these pipelines: I have set the password in both pipelines and edited my password in the Dockerfile to look like this:
ENV SA_PASSWORD=$(SA_PASSWORD)
But that does not seem to be working. What is the correct way of passing environment variables from Azure DevOps into a Docker image?
Also, is this a safe way of passing secrets? Is there any way someone could read secrets from a Docker image?
Thanks!