GithubHelp home page GithubHelp logo

azureclicredentialcontainer's People

Contributors

jongio avatar saurabh-mridul avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

azureclicredentialcontainer's Issues

This solution no longer works after installing Azure CLI v2.30.0 or higher on the host

To get this working, I had to downgrade to Azure CLI v2.29 or earlier on both the host and in the container. In the Container this meant changing this line to the following:

RUN apt-get update \
    && apt-get install ca-certificates curl apt-transport-https lsb-release gnupg  -y

RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
    gpg --dearmor | \
    tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null

RUN AZ_REPO=$(lsb_release -cs) \
    && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
    tee /etc/apt/sources.list.d/azure-cli.list

RUN apt-get update && \
    apt-get install azure-cli=2.29.2-1~buster

and then installing the same version on the host machine from the Azure CLI Releases page

Need to install curl first before installing the AZ CLI

Awesome and easy solution, however I run in to issues while following the instructions. I realized that we also need to ensure that curl is installed on the container before we try installing the azure CLI, I have update the docker images as -

FROM mcr.microsoft.com/dotnet/core/runtime:3.1 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY ["AzureCliCredentialContainer.csproj", "./"]
RUN dotnet restore "./AzureCliCredentialContainer.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "AzureCliCredentialContainer.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "AzureCliCredentialContainer.csproj" -c Release -o /app/publish

FROM base AS final
RUN apt-get clean && apt-get update
RUN apt install curl -y
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AzureCliCredentialContainer.dll"]

Azure CLI not installed

Hi,

I am getting Azure CLI not installed error when running docker-compose even if I put the RUN commands in docker files.

The docker-compose loads 3 separate docker files which all contain this last step:

FROM base AS final
RUN apt-get clean && apt-get update
RUN apt install curl -y
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
ENTRYPOINT ["dotnet", "IdentityServer.dll"]

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.