@lidstah@lemmy.sdf.org avatar

lidstah

@lidstah@lemmy.sdf.org

This profile is from a federated server and may be incomplete. Browse more on the original instance.

lidstah, (edited )
@lidstah@lemmy.sdf.org avatar

A bit late but you might want to have a look at docker multi-stage build documentation which does exactly what you did (start from a base image then copying stuff from it to your own image), something like that:


<span style="color:#323232;">FROM someimage:sometag AS build
</span><span style="color:#323232;">[do stuff]
</span><span style="color:#323232;">FROM minimalimage:someothertag
</span><span style="color:#323232;">COPY --from=build /some/file /some/other/file
</span><span style="color:#323232;">[and so on]
</span><span style="color:#323232;">USER somebody
</span><span style="color:#323232;">CMD ["/path/somecommand"]
</span>

Which will simplify building new images against newer “build” image newer tags easier.

btw, you were quite creative on this one! You also might want to have a look at the distroless image, the goal being to only have the bare minimum to run your application in the image: your executable and its runtime dependencies.

lidstah,
@lidstah@lemmy.sdf.org avatar

You’re welcome! scratch and distroless are indeed basically the same thing, scratch being the ‘official’ docker minimal image while distroless is from google - as I’m more a Kubernetes user (at home and at work) than a Docker user, I tend to think about distroless first :) - my apologies if my comment was a bit confusing on this matter.

By the way, have fun experimenting with docker (or podman), it’s interesting, widely used both in selfhosting and professional environments, and it’s a great learning experience - and a good way to pass time during these long winter evenings :)

lidstah,
@lidstah@lemmy.sdf.org avatar

good old x201 here (i5-720m iirc), 8GB ram, sata ssd. Debian stable. No DE, just stumpWM. Not watching 4k youtube videos but runs fairly well for a 13 years old machine.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #