Drastically reduce the size of your DOCKER images with MULTISTAGE builds

preview_player
Показать описание
I'm always surprised how few people know about Docker Multistage builds. I've even see people manually try and replace a Multistage build with two regular docker builds. When you start up your first Kubernetes cluster for the first time you probably realize just how expensive cloud resources can be. So if you can reduce the size of your Docker images and containers by 85% with just 4 lines of code ... you might want to go for it!

Рекомендации по теме
Комментарии
Автор

Thanks. I reduced size of my container from 12GB to 6MB. :)

kaksisve
Автор

best way to explain something - hands on and simple. good work.

kindalost
Автор

Dude you are a God! Was racking my brain on how to reduce my image size because they were in Giga size! This video is gold!

UltimateKeyboardHero
Автор

I was actually looking for a tutorial on how to do CI/CD with docker containers. This video explained everything I didnt find out yet eventhough it was meant for something else. Really great video! Please do more on docker images and building and deployment!

THEMithrandir
Автор

Good Vid! in production you should use distroless images though. In staging for debugging a normal distro image is completely fine though !

dermuschelschluerfer
Автор

Can you please tell me how this reduced the size? To my understanding, you created new container with alpine but you also copied the entire previous folder too. What is the difference in old and new container to be precise?

blackkiritok
Автор

super Docker Image Reduction from 600 MB to 10 MB, Cool features.

gunahk
Автор

I got confused in minute 3:40. It looks like he is using COPY --from=builder /go/src/app/ /app/. Is the image going two containers in one dockerfile? If he is, Is he using the same golang:alpine image in the second base image?

rodrigocalderone
Автор

go: cannot find main module; see 'go help modules'
The command '/bin/sh -c GOOS=linux go build -a -installsuffix cgo -o helloworld .' returned a non-zero code: 1

getting this problem when i do changes in dockerfile FROM golang:alpine

bhushanmahadik
Автор

simple and to the point, thank you :)

a_maxed_out_handle_of__chars
Автор

Thanks for the video. I have Django, Apache, React. How do I do this. It's little unclear about the video. First image has go lang libraries. Second one you are starting with alpine and where are go lang libraries. you are copying your app file only.

theconfusedchannel
Автор

Great video mate, I have a question in my mind. If I put three FROM in docker file it's not running from the second FROM line ? The idea is atlast in Third FROM I have to use my base image.

SunilKumar-pgxf
Автор

Can you upload basic videos of docker and kubernetes

nikhilstephen
Автор

what about the memory footprints if you are utilizing the lower layers somewhere else as well? are we saving by this way also some?

marcello
Автор

But anyway why is he building the application inside the docker container ? What about doing the building outside and push the final build artifacts into a tiny base image?

TJ-hsqm
Автор

You have copied the application folder but what about the required binaries of golang?

kannan
Автор

so the conclusion is we cannot run the image built with base image "scracth"?, or we can actually run is like usual, buat we just can execute linux/OS bash command ?

louisaldorio
Автор

What is the best way to do something like this with a container from a Dockerhub?

algollunism
Автор

How did you run the go file in Alpine without golang?

polliluiz
Автор

Do you really need a workdir or can you just go to town at the root?

malikbrahimi