Build Container Images With Nix In Kubernetes
MIT License
n2k8s is an image to build container images from a Nix expression, inside a container or Kubernetes cluster and push it to a registry.
The contents of this repo are currently a WIP
The n2k8s image is available on the Docker Hub:
docker run -v $PWD/examples:/build lewo/n2k8s /entrypoint --context /build --destination localhost:5000/hello
See also the docker-compose
stack.
n2k8s
gets registry credentials from the Docker's cli config file
(located at $HOME/.docker/docker.json
in the container).
To interact with the AWS ECR
docker.json
file must contains a credHelper
section:{
"credHelpers": {
"aws_account_id.dkr.ecr.region.amazonaws.com": "ecr-login"
}
}
~/.aws/credentials
must be mounted to/root/.aws/credentials
(usually provided by Kubernetes secret)useSandbox = false
optionnal/nix/store
)