Docker
Use a BuildKit secret to give the Babel MSBuild task access to a signed babel.licenses file during a Docker build. This works with Babel 12.3.0 and an Ultimate or higher license.
Keep the license file outside the Docker build context. Pass its path to BuildKit from the project directory.
docker build --secret id=babel_license,src=/secure/path/babel.licenses .In the build stage of your Dockerfile, mount the secret on the instruction that runs Babel. This example assumes the project and its restored packages are already available in that stage.
RUN --mount=type=secret,id=babel_license,required=true \
dotnet build -c Release --no-restore -p:BabelLicense=/run/secrets/babel_licenseUse the same mount and property on dotnet publish if your project runs Babel during publishing. The file exists only while that instruction runs. Keep the license out of COPY, ARG and ENV instructions.
If Azure DevOps starts the Docker build, use the path returned by DownloadSecureFile@1 for the src argument. See Azure DevOps and the Docker BuildKit secrets guide .