All blog posts Know-howProduct news 7 mins read

Why We Added Dockerfile Support to Deploio

Tim Grethler
Written by
Tim Grethler
Published
October 8, 2024
Share this post

Introduction

At Nine, we’ve been hard at work refining Deploio, our platform for deploying applications with ease. If you’ve been following our journey, you already know about the significant advancements we’ve made. If you’re new, I recommend reading our previous blog post or having a look at our docs, where we introduced Deploio and explained its core functionality.

Today, we’re excited to announce a new addition to the platform: Dockerfile Support. This enhancement is a big step forward, particularly for teams and developers who need more control over and further customisation of their deployment process. But to truly appreciate the significance of this update, it’s important to understand how Deploio has been handling application builds up until now.

How We Built Applications Before: Buildpacks

From the beginning, Deploio has relied on Buildpacks to automate the process of turning your source code into runnable container images. The process is straightforward: once you link your Git repository to Deploio and select the branch or environment, Deploio automatically detects the type of application in your codebase. Based on what it finds, the appropriate Buildpack is selected to handle the build process. In theory, this sounds quite easy but brings the complexity of always making an assumption about which plugins, extensions or plain dependencies could be expected.

But What Exactly Are Buildpacks? And Why Do They Matter?

What Is a Buildpack?

A Buildpack is essentially an automated tool that converts source code into a runnable container image without the need for a Dockerfile, or any other complex configuration. Think of it as a way to abstract away the complexities of building containers, making it an appealing option for teams that might not be familiar with Docker or container technologies in general.

The beauty of Buildpacks lies in their simplicity. They detect your code’s language and dependencies, and build your application on a pre-configured, trusted base image. This means you can go from writing code to having a fully functional container without ever touching a Dockerfile. Once the building step is complete, you can even download your docker image.

Why Buildpacks Have Been Great (Until Now)

The simplicity of Buildpacks is their biggest strength – by abstracting away the container-building process, they allow developers to focus solely on writing code, without worrying about configuring the underlying infrastructure. This is especially beneficial for teams that want to move fast, without having to dive into the nitty-gritty of containerization.

Moreover, the pre-built base images that Buildpacks rely on are maintained by trusted sources, meaning that security and performance optimizations are handled behind the scenes. This further reduces the burden on developers, allowing them to focus on what they do best: building applications.

However, as convenient as Buildpacks are, they come with their own set of limitations, especially when dealing with more complex or non-standard workloads.

The Limitations of Buildpacks

While Buildpacks provide a quick and secure way to get applications running, they aren’t always flexible enough for every use case. The very abstraction that makes Buildpacks so user-friendly can also make them limiting when you need more granular control over your container builds.

For example, Buildpacks rely on pre-configured base images, which may not always suit applications with specific requirements. If your app needs a custom dependency or a particular version of a system library, Buildpacks might not be able to accommodate that. Moreover, debugging issues with Buildpacks can sometimes feel like shooting in the dark, since much of the build process happens behind the scenes. This leads to a back-and-forth between our customers and us, and at times even results in us forking Buildpacks to allow further customization. 

In other words, while Buildpacks simplify deployment for standard applications, they can become a roadblock for teams in need of more fine-tuned control. That’s why we’ve introduced Dockerfile Support on Deploio.

What Is a Dockerfile?

If you are reading this blog, chances are you are familiar with the concept of Dockerfiles. Nevertheless, I want to provide you with a “simple” explanation of what they are and how they work.

A Dockerfile is a script that contains a series of instructions on how to build a Docker image. Unlike Buildpacks, which rely on predefined rules and base images, Dockerfiles give developers full control over every step of the containerization process.

With a Dockerfile, you can specify everything from the base image you want to use to how dependencies are installed, which ports should be exposed, and how the application is started. This level of control is invaluable when you’re working on complex applications or have specific performance, security, or environmental requirements.

Why Dockerfiles Are a Game-Changer for Deploio

By introducing Dockerfile support on Deploio, we’re giving you, the developer, more flexibility and power over how your applications are built and run. Here are some key reasons why Dockerfiles matter:

  1. More Complex Workloads: With Dockerfiles, you can define your environment with precision. This is particularly important for applications with complex requirements, such as custom dependencies, specific operating system configurations, or legacy components. Dockerfiles give you the freedom to tailor the container to your application’s exact needs.
  2. Control Over the Build Process: While Buildpacks handle everything for you, Dockerfiles allow you to take control of the build process. This can lead to more optimized builds, as you can control caching, layer management, and even the size of your final container image.
  3. Flexibility in Base Images: Buildpacks force you to use pre-built base images, which may or may not be ideal for your specific use case. With Dockerfiles, you can choose any base image you like. Whether you want a minimal Alpine image to keep your container lightweight, or a custom-built base image for enterprise applications, the choice is yours.
  4. Debugging and Troubleshooting: Since Dockerfiles give you complete insight into how your container is built, they make it easier to troubleshoot issues. If something goes wrong during the build, you can pinpoint exactly which step caused the issue and fix it, without having to dig through layers of abstraction.

Using Dockerfiles on Deploio

With Dockerfile support now fully integrated into Deploio, you’ve got the freedom to choose the best tool for the job – whether that’s sticking with the streamlined simplicity of Buildpacks or diving into the granular control that Dockerfiles offer. Buildpacks are still an excellent choice when you want to focus purely on development without worrying about the underlying infrastructure. They abstract away the complexities of containerization, saving time and minimizing configuration – perfect for getting applications up and running quickly and securely.

But for those times when you need that extra level of control – when your app demands custom dependencies, specific system configurations, or optimizations – Dockerfiles open up a whole new world of possibilities. Want to fine-tune your image layers? Use a specific base image? Optimize for minimal footprint? Dockerfiles let you do all of that and more, offering flexibility that’s ideal for complex, non-standard workloads.

Deploying with Dockerfiles is as simple as adding your Dockerfile to your repository. Deploio will automatically detect it, allowing you to customize everything from the OS down to the tiniest dependencies. If you’re ready to get started, head over to our Dockerfile Build documentation for a deep dive into the process.

Whether you’re running with Buildpacks for speed or leveraging Dockerfiles for customization, Deploio has you covered. Ready to take it for a spin? Let’s see what new ideas you bring to life with this added flexibility.