Drastically reduce the size of your DOCKER images with MULTISTAGE builds

Drastically reduce the size of your DOCKER images with MULTISTAGE builds

kubucation

6 лет назад

70,982 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Luiz Polli
Luiz Polli - 22.08.2023 01:24

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

Ответить
Diego Doná
Diego Doná - 02.05.2023 04:51

Direct to the point. Thanks.

Ответить
Fazlur Rahmatullah
Fazlur Rahmatullah - 08.03.2023 20:15

=> ERROR [builder 4/4] RUN go build -o webserver .
> [builder 4/4] RUN go build -o webserver .:
#0 0.649 go: go.mod file not found in current directory or any parent directory; see 'go help modules'
------
ERROR: failed to solve: executor failed running [/bin/sh -c go build -o webserver .]: ex


why iam error? can help me to explain this?

Ответить
Pexers
Pexers - 24.02.2023 19:42

Great video! Thanks!

Ответить
sankharr
sankharr - 06.01.2023 06:29

Thank you for this video! :)

Ответить
Tim
Tim - 28.12.2022 13:27

Thanks really clear

Ответить
Deepak Kumar
Deepak Kumar - 26.12.2022 09:36

Ответить
Виталий Пугач
Виталий Пугач - 23.09.2022 13:51

Thanks a lot

Ответить
Night Fury
Night Fury - 10.09.2022 01:23

simple and to the point, thank you :)

Ответить
Nackro Mancer
Nackro Mancer - 18.08.2022 07:17

This is awesome, thank you.

Ответить
Vignesh
Vignesh - 10.05.2022 21:26

Error: error preparing container a005d60bbe11f0d23810156 for attach: crun: executable file `./webserver` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
Tried the same and received when try to do podman run

Ответить
Firefox
Firefox - 04.03.2022 23:31

fantastic video. thanks for posting

Ответить
marcello42
marcello42 - 11.01.2022 22:29

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

Ответить
T J
T J - 01.11.2021 16:51

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?

Ответить
THE cOnFUsED CHANNEL
THE cOnFUsED CHANNEL - 05.09.2021 19:03

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.

Ответить
Martin Møller Skarbiniks Pedersen
Martin Møller Skarbiniks Pedersen - 07.07.2021 00:30

Thanks for the video. However it doesn't work anymore.
$ cat Dockerfile-2.df
FROM golang:latest AS builder
WORKDIR /go/src/app
COPY main.go .
RUN go build -o webserver .

FROM alpine
WORKDIR /app
COPY --from=builder /go/src/app/ /app/
CMD ["./webserver"]

$ docker build -t webserver -f Dockerfile-2.df .
Sending build context to Docker daemon 4.096kB
Step 1/8 : FROM golang:latest AS builder
---> ee23292e2826
Step 2/8 : WORKDIR /go/src/app
---> Using cache
---> 57fe449c0365
Step 3/8 : COPY main.go .
---> Using cache
---> ac48e92ef385
Step 4/8 : RUN go build -o webserver .
---> Running in baa4d55b7073
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
The command '/bin/sh -c go build -o webserver .' returned a non-zero code: 1

Ответить
Shamil Mammadov
Shamil Mammadov - 03.06.2021 01:03

I have to try it tomorrow with my nodejs app)

Ответить
Emprendedores Bolsa
Emprendedores Bolsa - 11.05.2021 23:26

Thanks for creating this video.

Ответить
Der Muschelschlürfer
Der Muschelschlürfer - 02.05.2021 21:27

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

Ответить
Ultimate Keyboard Hero
Ultimate Keyboard Hero - 28.04.2021 08:39

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!

Ответить