How to set environment variables in Dockerfile via Azure DevOps

后端 未结 4 1628
栀梦
栀梦 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:38

    I suggest to set the environment variables at runtime. If you are deploying to an Azure App Service, app settings are injected into the process as environment variables automatically.

    You can then use the same image for multiple environments. With the Deploy Azure App Service task in a release pipeline, you can change the app settings for each environment.

    https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#configure-environment-variables

提交回复
热议问题