Docker - Dockerfile publish to use selected publish profile The Next CEO of Stack OverflowHow is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersWhat is the difference between CMD and ENTRYPOINT in a Dockerfile?Copying files from Docker container to hostCopying files from host to Docker containerWhat is the difference between the `COPY` and `ADD` commands in a Dockerfile?publish a web api based on asp.net core RC2 on docker

Is it professional to write unrelated content in an almost-empty email?

Should I tutor a student who I know has cheated on their homework?

Is there a difference between "Fahrstuhl" and "Aufzug"

Which one is the true statement?

"misplaced omit" error when >centering columns

Flying from Cape Town to England and return to another province

I want to delete every two lines after 3rd lines in file contain very large number of lines :

How a 64-bit process virtual address space is divided in Linux?

Won the lottery - how do I keep the money?

Is it possible to replace duplicates of a character with one character using tr

Is there always a complete, orthogonal set of unitary matrices?

Can MTA send mail via a relay without being told so?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

Rotate a column

Why is my new battery behaving weirdly?

Why, when going from special to general relativity, do we just replace partial derivatives with covariant derivatives?

Does it make sense to invest money on space investigation?

Make solar eclipses exceedingly rare, but still have new moons

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

RigExpert AA-35 - Interpreting The Information

Newlines in BSD sed vs gsed

What flight has the highest ratio of time difference to flight time?

0 rank tensor vs 1D vector

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?



Docker - Dockerfile publish to use selected publish profile



The Next CEO of Stack OverflowHow is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersWhat is the difference between CMD and ENTRYPOINT in a Dockerfile?Copying files from Docker container to hostCopying files from host to Docker containerWhat is the difference between the `COPY` and `ADD` commands in a Dockerfile?publish a web api based on asp.net core RC2 on docker










0















First off, let me start by saying I am fairly new to docker and trying to understand the dockerfile setup.



We are currently trying to convert our existing WepApi services to support containerization and orchestration. The plan is to use Docker with Kubernetes. We currently utilize multiple publish profiles with then drive the WebConfig based on the selected publish profile.



Looking through the dockerfile, I see stuff such as:



RUN dotnet restore 
"Aeros.Services.Kubernetes/Aeros.Services.Kubernetes.csproj"
COPY . .
WORKDIR "/src/Aeros.Services.Kubernetes"
RUN dotnet build "Aeros.Services.Kubernetes.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c Release -o /app


Where the -c supplies the configuration. Is there any way to get it to run this command based on the publishing profile the user has selected?










share|improve this question


























    0















    First off, let me start by saying I am fairly new to docker and trying to understand the dockerfile setup.



    We are currently trying to convert our existing WepApi services to support containerization and orchestration. The plan is to use Docker with Kubernetes. We currently utilize multiple publish profiles with then drive the WebConfig based on the selected publish profile.



    Looking through the dockerfile, I see stuff such as:



    RUN dotnet restore 
    "Aeros.Services.Kubernetes/Aeros.Services.Kubernetes.csproj"
    COPY . .
    WORKDIR "/src/Aeros.Services.Kubernetes"
    RUN dotnet build "Aeros.Services.Kubernetes.csproj" -c Release -o /app

    FROM build AS publish
    RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c Release -o /app


    Where the -c supplies the configuration. Is there any way to get it to run this command based on the publishing profile the user has selected?










    share|improve this question
























      0












      0








      0








      First off, let me start by saying I am fairly new to docker and trying to understand the dockerfile setup.



      We are currently trying to convert our existing WepApi services to support containerization and orchestration. The plan is to use Docker with Kubernetes. We currently utilize multiple publish profiles with then drive the WebConfig based on the selected publish profile.



      Looking through the dockerfile, I see stuff such as:



      RUN dotnet restore 
      "Aeros.Services.Kubernetes/Aeros.Services.Kubernetes.csproj"
      COPY . .
      WORKDIR "/src/Aeros.Services.Kubernetes"
      RUN dotnet build "Aeros.Services.Kubernetes.csproj" -c Release -o /app

      FROM build AS publish
      RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c Release -o /app


      Where the -c supplies the configuration. Is there any way to get it to run this command based on the publishing profile the user has selected?










      share|improve this question














      First off, let me start by saying I am fairly new to docker and trying to understand the dockerfile setup.



      We are currently trying to convert our existing WepApi services to support containerization and orchestration. The plan is to use Docker with Kubernetes. We currently utilize multiple publish profiles with then drive the WebConfig based on the selected publish profile.



      Looking through the dockerfile, I see stuff such as:



      RUN dotnet restore 
      "Aeros.Services.Kubernetes/Aeros.Services.Kubernetes.csproj"
      COPY . .
      WORKDIR "/src/Aeros.Services.Kubernetes"
      RUN dotnet build "Aeros.Services.Kubernetes.csproj" -c Release -o /app

      FROM build AS publish
      RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c Release -o /app


      Where the -c supplies the configuration. Is there any way to get it to run this command based on the publishing profile the user has selected?







      visual-studio docker kubernetes






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 18:06









      Nathan RaleyNathan Raley

      185




      185






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You could use an ARG statement in your Dockerfile.



          ARG publishingProfile
          RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c $publishingProfile -o /app


          Use it like this from the command line:
          docker build --build-arg publishingProfile=Release






          share|improve this answer























          • Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

            – oneklc
            Mar 21 at 18:54












          • thanks everyone, I think that will get me going in the right direction.

            – Nathan Raley
            Mar 21 at 19:45











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286682%2fdocker-dockerfile-publish-to-use-selected-publish-profile%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You could use an ARG statement in your Dockerfile.



          ARG publishingProfile
          RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c $publishingProfile -o /app


          Use it like this from the command line:
          docker build --build-arg publishingProfile=Release






          share|improve this answer























          • Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

            – oneklc
            Mar 21 at 18:54












          • thanks everyone, I think that will get me going in the right direction.

            – Nathan Raley
            Mar 21 at 19:45















          1














          You could use an ARG statement in your Dockerfile.



          ARG publishingProfile
          RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c $publishingProfile -o /app


          Use it like this from the command line:
          docker build --build-arg publishingProfile=Release






          share|improve this answer























          • Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

            – oneklc
            Mar 21 at 18:54












          • thanks everyone, I think that will get me going in the right direction.

            – Nathan Raley
            Mar 21 at 19:45













          1












          1








          1







          You could use an ARG statement in your Dockerfile.



          ARG publishingProfile
          RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c $publishingProfile -o /app


          Use it like this from the command line:
          docker build --build-arg publishingProfile=Release






          share|improve this answer













          You could use an ARG statement in your Dockerfile.



          ARG publishingProfile
          RUN dotnet publish "Aeros.Services.Kubernetes.csproj" -c $publishingProfile -o /app


          Use it like this from the command line:
          docker build --build-arg publishingProfile=Release







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 21 at 18:47









          Thomas HirschThomas Hirsch

          910622




          910622












          • Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

            – oneklc
            Mar 21 at 18:54












          • thanks everyone, I think that will get me going in the right direction.

            – Nathan Raley
            Mar 21 at 19:45

















          • Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

            – oneklc
            Mar 21 at 18:54












          • thanks everyone, I think that will get me going in the right direction.

            – Nathan Raley
            Mar 21 at 19:45
















          Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

          – oneklc
          Mar 21 at 18:54






          Other option is to use an environment variable and pass it in during the build stage but in the case i think using the build arg is the correct way to go. docs.docker.com/engine/reference/commandline/build/…

          – oneklc
          Mar 21 at 18:54














          thanks everyone, I think that will get me going in the right direction.

          – Nathan Raley
          Mar 21 at 19:45





          thanks everyone, I think that will get me going in the right direction.

          – Nathan Raley
          Mar 21 at 19:45



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286682%2fdocker-dockerfile-publish-to-use-selected-publish-profile%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현