-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
32 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# https://github.com/Azure/azure-cli/issues/19591
# https://iceburn.medium.com/azure-cli-docker-containers-7059750be1f2
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine AS base
ENV DOTNET_CLI_TELEMETRY_OPTOUT=true \
AZ_INSTALLER=DOCKER
RUN apk add --no-cache py3-pip && \
apk add --no-cache --virtual=build gcc musl-dev python3-dev libffi-dev openssl-dev cargo make && \
pip install --no-cache-dir --break-system-packages azure-cli && \
apk del --purge build
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV AZURE_CONFIG_DIR=/app/.azure
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS publish
WORKDIR /src
COPY . .
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
dotnet publish "AzureCliCredentialProxy.csproj" -c Release -r linux-musl-x64 -o /app/publish; \
else \
dotnet publish "AzureCliCredentialProxy.csproj" -c Release -r linux-musl-arm64 -o /app/publish; \
fi
FROM base AS final
RUN chown -R app /app
USER app
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["./AzureCliCredentialProxy"]