DEV Community

Marcos Henrique
Marcos Henrique

Posted on • Updated on

You should use Buildpacks instead Dockerfile and I'll tell you why

Everyone knows the benefits of docker, building containers from a dockerfile is lit asf🥵 in terms of productivity, we can build and distribute applications as a piece of cake.

Despite this developers must have a knowledge in detail of how the commands in a Dockerfile relate to Docker layers and the circumstances under which layers can, and can not, be reused.

Buildpacks abstract away much of the deeply understanding required to build a Docker image with battle-tested scripts leveraging advanced features like volumes to build images swiftly and wisely.

Okay, I get it! But show us why we should believe you 🤨

  • Buildpacks is a cncf projet;
  • Productivity: Removing a lot of onboarding friction for teams looking to move their applications in terms of a previous knowledge in docker;
  • Security: Many modern applications include dozens, if not thousands, of dependencies that perform many standard plumbing and infrastructural concerns;
  • Performance: Buildpacks are smarter in the way they handle application dependencies, Writing a Dockerfile that ensures that rebuilt images do so quickly and efficiently might as well be an "occultism art" 🧙‍♂️, Buildpacks encode this knowledge into their implementation.
  • It's not only for Docker: Buildpacks embrace the OCI format, so feel free to use some Podman, Containerd or RunC;

If you have that doubt and want to know how to implement, take a look at this amazing article by Matthew Casperson where he builds a node application and goes from docker to buildpacks.

Discussion (1)

Collapse
clavinjune profile image
Clavin June

but still, using a private golang module has not supported yet