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
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
add a comment |
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
add a comment |
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
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
visual-studio docker kubernetes
asked Mar 21 at 18:06
Nathan RaleyNathan Raley
185
185
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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