/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/devops/snippets/create-dotnet-github-action/Dockerfile
26 строк
1 KB
David Pine
[StepSecurity] Apply security best practices (#2417) (#41814)
17 июл 2024, 20:01
Не верифицирован
17 июл 2024, 20:01
0fd0f30
Код
Авторство
О чём код?
# Set the base image as the .NET 7.0 SDK (this includes the runtime) FROM mcr.microsoft.com/dotnet/sdk:7.0@sha256:d32bd65cf5843f413e81f5d917057c82da99737cb1637e905a1a4bc2e7ec6c8d as build-env # Copy everything and publish the release (publish implicitly restores and builds) WORKDIR /app COPY . ./ RUN dotnet publish ./DotNet.GitHubAction/DotNet.GitHubAction.csproj -c Release -o out --no-self-contained # Label the container LABEL maintainer="David Pine <david.pine@microsoft.com>" LABEL repository="https://github.com/dotnet/samples" LABEL homepage="https://github.com/dotnet/samples" # Label as GitHub action LABEL com.github.actions.name="The name of your GitHub Action" # Limit to 160 characters LABEL com.github.actions.description="The description of your GitHub Action." # See branding: # https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#branding LABEL com.github.actions.icon="activity" LABEL com.github.actions.color="orange" # Relayer the .NET SDK, anew with the build output FROM mcr.microsoft.com/dotnet/sdk:7.0@sha256:d32bd65cf5843f413e81f5d917057c82da99737cb1637e905a1a4bc2e7ec6c8d COPY --from=build-env /app/out . ENTRYPOINT [ "dotnet", "/DotNet.GitHubAction.dll" ]