DevX is a command-line tool designed to simplify the development workflow for containerized applications. It helps developers manage projects, build Docker images, and update deployments in Kubernetes environments.
- Colima for local Kubernetes development
- Colima with Docker runtime for building and managing containers
brew install zenginechris/tap/devx
{
inputs = {
devx = {
url = "github:zenginechris/devx";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
devx
} @ inputs: let
configuration = {pkgs, ...}: {
nixpkgs.overlays = [
(final: prev: {
devx-cli = devx.packages.${prev.system}.default;
})
];
environment.systemPackages = [
pkgs.devx-cli
];
};
}
coming soon
DevX requires a running Kubernetes cluster managed by Colima. Use the following command to start Colima with the appropriate configuration:
colima start --cpu 8 --memory 26 --disk 50 --vm-type=vz --vz-rosetta --runtime docker --kubernetes
This command:
- Allocates 8 CPUs and 26GB of memory
- Provides 50GB of disk space
- Uses the vz virtualization type with Rosetta translation
- Sets Docker as the runtime
- Enables Kubernetes support
devx list
# or
devx ls
Lists all configured projects showing their names and build contexts.
devx new <project-name>
# or
devx n <project-name>
Creates a new project with the specified name. This command:
- Adds the project to your configuration
- Creates a default Dockerfile in the project directory
devx context <project-name> [path]
# or
devx c <project-name> [path]
Sets the build context for a project. If no path is specified, it uses the current directory.
devx edit <project-name> docker
# or
devx e <project-name> docker
Opens the project's Dockerfile in your default editor for modification.
cd ~.config/devx
Here you can find a devx.toml file that contains all of your configured projects. The file looks a like that:
[[projects]]
name = 'ui'
context = '/Users/chris/github.com/project/ui' # this is the current building context that can be set by the cli
config_path = '/Users/cbartelt/.config/devx/projects/ui' # project specific configuration like the Dockerfile
contexts = [] # additional files and folders that are copied to the build context
deployment_name = 'ui' # the kubernetes deployment name. The building command will update this with the built image tag
namespace = 'default' # the namespace the deployment is in
[[projects]]
name = 'api'
context = ''
config_path = '/Users/cbartelt/.config/devx/projects/api'
contexts = []
deployment_name = 'api'
namespace = 'default'
devx build <project-name>
# or
devx b <project-name>
Builds a Docker image from the project's context and updates the deployment in your Kubernetes cluster. This command:
- Creates a temporary build directory
- Copies the project context and Dockerfile
- Builds a Docker image tagged with the project name and current timestamp
- Updates the deployment in the current Kubernetes context
- Multi-architecture support: Builds images for both AMD64 and ARM64 architectures when using Docker BuildX
- Build caching: Implements local caching to speed up subsequent builds
- Automatic deployment: Updates Kubernetes deployments after successful builds
- Flexible configuration: Supports multiple build contexts and custom Dockerfile configurations
DevX stores its configuration in a central location. You can manage projects and their settings through the CLI commands.
# Create a new project
devx new my-go-app
# Set the build context to the current directory
devx context my-go-app
# Edit the Dockerfile if needed
devx edit my-go-app docker
# Build and deploy the project
devx build my-go-app
devx list
EDITOR
orVISUAL
: Specifies the editor to use for theedit
command. If not set, DevX will try to usenano
,vim
, orvi
in that order.
- The CLI automatically creates a default Go application Dockerfile when creating a new project
- Project names are converted to lowercase and spaces are replaced with hyphens for use in image names and directories
- DevX requires a running Kubernetes cluster managed by Colima for deployment functionality