How to set environment variables in Dockerfile via Azure DevOps

后端 未结 4 1623
栀梦
栀梦 2021-01-19 21:45

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_POR         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-19 22:36

    I am using the Replace Tokens extension for exactly tasks like this: https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens

    However, putting secrets into your Dockerfile might not be the best idea. Usually you would provide secrets or generally runtime configuration as environment variables when you actually execute the container.

提交回复
热议问题