question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Build docker images

See original GitHub issue

Guys, one question, how you built the images before pushing them on Docker registry? just build the solution on release mode, tag and push the image?

I have a doubt how to tell docker that takes the aspnetcore image instead of aspnetcore-build

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eiximeniscommented, May 22, 2018

Hi @vany0114 On a multi-stage Dockerfile only one image persists and its generated as a output of the Dockerfile: the one declared in the latest FROM.

As you can see in our Dockerfiles the latest FROM always is FROM base as XXX and base image is the one created from microsoft/aspnetcore:2.0.5. But of course, this is up to you 😃

1reaction
CESARDELATORREcommented, May 15, 2018

Yeah, you can do so for dev/test environments, directly from your PC. But in a real project, that should be done by your CI/CD pipelines like when using VSTS, like we have for eShopOnContainers, so the push to Docker Hub is performed by the CI pipeline. About the base image, take into account that we’re using Docker Multi-Stage build, so the base image for most of our containers is always microsoft/aspnetcore , not aspnetcore-build which is only used by Docker when compiling the .NET project and when building the Docker image with the Docker Multi-Stage Build dockerfiles. This is one example of one of our dockerfiles using Docker Multi-Stage Build: https://github.com/dotnet-architecture/eShopOnContainers/blob/dev/src/Services/Catalog/Catalog.API/Dockerfile

For more info on Docker Multi-Stage Build, see: https://docs.microsoft.com/en-us/dotnet/core/docker/building-net-docker-images https://docs.docker.com/develop/develop-images/multistage-build/

Docker Multi-Stage Build is new for .NET Core images since late 2017, btw.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image-building best practices
Tips for building images for your application. ... there's an important lesson to learn to help decrease build times for your container images....
Read more >
Top 50 Docker Interview Questions and Answers in 2023
This blog features the top DevOps - Docker interview questions and answers ... In other words, Docker images are used to create containers....
Read more >
Top Docker Interview Questions and Answers (2023)
Docker Basic Interview Questions · 1. Can you tell something about docker container? · 2. What are docker images? · 3. What is...
Read more >
Top 25 Docker Interview Questions and Answers for 2023
Basic Docker Interview Questions for Beginners · 1. What is Docker? · 2. What are Docker's most notable features? · 3. Why should...
Read more >
Top 30 Docker Interview Questions & Answers [Updated ...
What is Docker's image? What is a Docker container? What is Docker Swarm? What is Dockerfile used for? How to create Docker container?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found