←back to thread

302 points Bogdanp | 1 comments | | HN request time: 0.207s | source
Show context
ahartmetz ◴[] No.44390744[source]
That person seems to be confused. Installing a single, statically linked binary is clearly simpler than managing a container?!
replies(3): >>44390794 #>>44390802 #>>44391204 #
jerf ◴[] No.44390802[source]
Also strikes me as not fully understanding what exactly docker is doing. In reference to building everything in a docker image:

"Unfortunately, this will rebuild everything from scratch whenever there's any change."

In this situation, with only one person as the builder, with no need for CI or CD or whatever, there's nothing wrong with building locally with all the local conveniences and just slurping the result into a docker container. Double-check any settings that may accidentally add paths if the paths have anything that would bother you. (In my case it would merely reveal that, yes, someone with my username built it and they have a "src" directory... you can tell how worried I am about both those tidbits by the fact I just posted them publicly.)

It's good for CI/CD in a professional setting to ensure that you can build a project from a hard drive, a magnetic needle, and a monkey trained to scratch a minimal kernel on to it, and boot strap from there, but personal projects don't need that.

replies(2): >>44392059 #>>44392854 #
linkage ◴[] No.44392854[source]
Half the point of containerization is to have reproducible builds. You want a build environment that you can trust will be identical 100% of the time. Your host machine is not that. If you run `pacman -Syu`, you no longer have the same build environment as you did earlier.

If you now copy your binary to the container and it implicitly expects there to be a shared library in /usr/lib or wherever, it could blow up at runtime because of a library version mismatch.

replies(1): >>44396230 #
1. missingdays ◴[] No.44396230[source]
Nobody is suggesting to copy the binary to the Docker container.

When developing locally, use `cargo test` in your cli. When deploying to the server, build the Docker image on CI. If it takes 5 minutes to build it, so be it.