In vs2019, I generate the docker image in the output window, the original command to generate the image was:
docker build -f "e:\work\dotnetcoreproject\rookie.qwt\rookie.qwt.webapi\dockerfile" --force-rm -t rookieqwtwebapi --label "com.microsoft.created-by=visual-studio" --label "com.microsoft.visual-studio.project-name=rookie.Qwt.WebApi" "e:\work\dotnetcoreproject\rookie.qwt"
I want to change the image name rookieqwtwebapi
to registry.rookie.qwt.webapi
, how can I do it in vs2019?
I want to change the image name rookieqwtwebapi to registry.rookie.qwt.webapi, how can I do it in vs2019?
According to the Microsoft's docs, there's a parameter of DockerfileTag
for this purpose:
The tag that will be used when building the Docker image. In debugging, a ":dev" is appended to the tag.
So do it as below:
<DockerfileTag/>
:<PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <UserSecretsId>65be249c-09e1-45ea-bac9-45d1cb4c82b6</UserSecretsId> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerfileTag>registry.rookie.qwt.webapi</DockerfileTag> </PropertyGroup>
Now VS will build the image with this tag of registry.rookie.qwt.webapi
(or registry.rookie.qwt.webapi:dev
when debugging) automatically .
Go to the Properties of the project and change the Assembly name. It will change the entire image name. Image tag can be added in Publish Profile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With