When we introduced Application Hosting, it came with two methods for setting up container images based on your repository: one using Buildpacks, which automates the container image setup, and the other via a Dockerfile, granting you the freedom to work with any programming language.
As part of our ongoing commitment to providing you with powerful tools and technologies to improve Application Hosting, we’re introducing Nixpacks as a new option to automatically create container images for your applications based on your repository.
What Is Nixpacks?
Similarly to Buildpacks, Nixpacks is an open-source project that creates your application’s container image based on your repository. Nixpacks scripts use Nix binary to build your application, install dependencies, and configure your environment when your application is deployed. It is written in Rust and offers a faster build time than Buildpacks.
It provides a standardized and simplified way to package and build applications by taking the source directory from your Git provider (BitBucket, GitHub, and GitLab) and automatically detecting an application’s language, framework, and runtime dependencies. It then creates a runnable artifact (such as a container image) containing everything you need to run your application.
One major benefit to using Nixpacks over Buildpacks is a built-in caching system for builds, which caches directories during the installation and build phases. This means after the first build is completed, subsequent builds are much faster.
Build Container Images at Kinsta With Nixpacks
When you add an application in Kinsta, you can choose to use Nixpacks to automatically determine and create a container for your application based on your repository.
We recommend using Nixpacks due to its resource-efficient code compilation, faster build and deployment times, and extensive language and framework support.
Additionally, please make sure to specify the build path if you are using a different directory as your build source, distinct from the root of your repository.
When using Nixpacks, you do not need to specify a provider to build for, as it automatically detects this based on the files in the source directory. If your application requires additional providers, you can define them within the Nixpacks configuration file.
Supported Languages
Nixpacks supports all major programming languages. You can find a comprehensive list in our documentation.
When using Nixpacks, you have to specify your language version in your application’s code. If you do not specify a version in your application’s code, Nixpacks uses the latest available version. To use a different language version, set the version in your application’s files.
If you want to use a language or a language version that is not a supported Nixpack language or version, use a Dockerfile. When you add your application, select the option Use Dockerfile to set up container image.
Experience the Future of Container Image Creation
We believe that Nixpacks is a game-changer for our users, offering more efficiency and flexibility to manage container images for your applications. As technology evolves, Kinsta is committed to staying at the forefront, providing you with cutting-edge solutions to simplify your development process.
Give Nixpacks a try today and experience the future of container image creation at Kinsta by reading our documentation for more information.
We’re excited to see how this new addition will empower you to build and deploy applications more efficiently than ever before.