Was recently somewhat surprised that you can’t just copy a Rust executable into a ´scratch´ container and have it work, so this is a cool blog post to find in my RSS feed.

I’m guessing, if you’re doing something less complex, then you just need the ´musl´ target and the allocator…

  • Hexorg ( Hexorg@beehaw.org ) 
    link
    fedilink
    arrow-up
    3
    ·
    1 month ago

    Why would you build docker images for Rust? I mean if you’re renting containers from data centers or just want to run in a sandbox - sure… but rust binaries are statically linked which negates almost all other benefits of containers.

        • Ephera ( Ephera@lemmy.ml ) OP
          link
          fedilink
          arrow-up
          5
          ·
          1 month ago

          You’re looking at it from the perspective of having coded a single application and wanting to deploy it. Try to think more like a sysadmin:

          • You’ve got a whole bunch of applications to deploy. Some of them may use dynamic linking, too.
          • You don’t know any of them too intimately, so want to just prevent them from interfering with each other, unless you allow it.
          • You want a uniform tool to manage all these different applications, and especially also when they’re allowed to interact.

          The result is deployment orchestration tools like Kubernetes, Docker Compose, Podman Compose etc… And as a dev, you have to provide a container image, if you want to play along in those.

          • Hexorg ( Hexorg@beehaw.org ) 
            link
            fedilink
            arrow-up
            1
            ·
            1 month ago

            Hmm there are plenty of tools to do that without containers… though I do see your point that docker provides a unified way of doing that which is easier.