I'm a Python, Go, Angular, and VueJS (Typescript) developer.
I'm a Linux fan (no other OS) and I try to contribute to projects like Fyne.io.
I do Machine Learning, Blender, and some other stuff.
Location
Laval, France
Work
DevOps, Go, TypeScript and Python development, Kubernetes/Docker/Podman tooling.
For languages than can be statically compiled like Go or Rust, the best is to use "FROM scratch" base and only append the binary in the image. Your images will only be a few Mb sized.
Hi! Thank you both for your comments. I understand what you say and I think it is correct. The problem—specific to this tutorial—is that scratch would not work with the project I am using here; at least not without some extra work, which would lead me to fix a few things and explain them (e.g., I would need a static build, a similar problem that I would have with Alpine), which in turn would cross the threshold of a "first steps" beginner post.
Hopefully, people will read this and be aware of this alternative for their particular projects.
I'm a Python, Go, Angular, and VueJS (Typescript) developer.
I'm a Linux fan (no other OS) and I try to contribute to projects like Fyne.io.
I do Machine Learning, Blender, and some other stuff.
Location
Laval, France
Work
DevOps, Go, TypeScript and Python development, Kubernetes/Docker/Podman tooling.
Hey, Rust does make static binaries by default. But when you use a dependency, it'll bring their own dependencies, and you may end up using one that happens to load something dynamically... Like libc for example.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For languages than can be statically compiled like Go or Rust, the best is to use "FROM scratch" base and only append the binary in the image. Your images will only be a few Mb sized.
I wanted to suggest scratch too. I once had made Rocket web app image as small as ~10MB. Probably it could be optimized even more.
Hi! Thank you both for your comments. I understand what you say and I think it is correct. The problem—specific to this tutorial—is that scratch would not work with the project I am using here; at least not without some extra work, which would lead me to fix a few things and explain them (e.g., I would need a static build, a similar problem that I would have with Alpine), which in turn would cross the threshold of a "first steps" beginner post.
Hopefully, people will read this and be aware of this alternative for their particular projects.
Ho, sorry, I thought that Rust makes static bainary by default. I just checked and I understand that I was wrong.
Reading this zderadicka.eu/static-build-of-rust... is a nice complement :)
Hey, Rust does make static binaries by default. But when you use a dependency, it'll bring their own dependencies, and you may end up using one that happens to load something dynamically... Like
libc
for example.