compose2nix
compose2nix copied to clipboard
Support for Compose Build spec
Here: https://docs.docker.com/compose/compose-file/build/
For a Git based build context, the generated Nix derivation needs to:
- Clone the repo (with a correct hash)
- Build a Docker imagee
This can be done using dockerTools.buildImage
+ fetchGit
.
This would then be provided as an input to the generated container using imageFile
.
Example of a Compose build service:
version: '3.5'
services:
prefetcharr:
build: https://github.com/p-hueber/prefetcharr.git
image: prefetcharr
environment:
- JELLYFIN_URL=http://example.com/jellyfin
- JELLYFIN_API_KEY=<YOUR KEY HERE>
- SONARR_URL=http://example.com/sonarr
- SONARR_API_KEY=<YOUR KEY HERE>
- LOG_DIR=/log
- RUST_LOG=prefetcharr=debug
volumes:
- /path/to/log/dir:/log