No description
Find a file
2026-04-03 02:04:36 +02:00
.guix Release 0.2.0. 2026-04-03 02:04:36 +02:00
scripts release.scm: Regenerate ChangeLog.md for each release. 2026-04-03 01:55:03 +02:00
src Release 0.2.0. 2026-04-03 02:04:36 +02:00
tests compose: Parse config sections of docker-compose.yml into Guix file-like objects. 2026-04-03 01:09:17 +02:00
.envrc Add BLUE commands. 2026-03-06 00:16:45 +01:00
.gitignore Add BLUE commands. 2026-03-06 00:16:45 +01:00
.guix-authorizations .guix-authorizations: Add 50E1 7BE0 D210 C883 D675 3150 4A3D 07EF D05C 4045. 2025-11-19 01:02:58 +01:00
.guix-channel .guix-channel: Drop dependency on gocix. 2026-02-23 17:55:46 +01:00
blueprint.scm Add BLUE commands. 2026-03-06 00:16:45 +01:00
ChangeLog.md Release 0.2.0. 2026-04-03 02:04:36 +02:00
guix.scm Init 2025-06-19 00:40:02 +02:00
manifest.scm Add BLUE commands. 2026-03-06 00:16:45 +01:00
README Init 2025-06-19 00:40:02 +02:00
README.org README.org: Update example command. 2026-04-01 01:55:17 +02:00

guix compose

guix compose is a Guix extension implementing a compatibility layer between docker-compose.yml files and Guix' OCI backed services. Guix services have many advantages over docker-compose.yml services, starting from atomic upgrades and rollbacks to deployability on remote systems. They are also supposed to be OCI runtime agnostic, currently rootless Podman and Docker are supported. guix compose allows you to migrate your existing docker-compose.yml to Guix' own OCI provisioning API.

For example a simple file like:

services:
  db:
    image: postgres:alpine3.22
    networks:
      - bonfire
  bonfire:
    image: bonfirenetworks/bonfire
    depends_on:
      - db
    networks:
      - bonfire
  nginx:
    image: nginx:stable-alpine3.23-perl
    networks:
      - bonfire
    depends_on:
      - bonfire
    ports:
      - '80:80'
      - '443:443'

networks:
  bonfire:

would be converted by guix compose import docker-compose.yml to Guix code like

(oci-extension
  (containers
    (list (oci-container-configuration
            (image "postgres:alpine3.22")
            (provision "db"))
          (oci-container-configuration
            (image "bonfirenetworks/bonfire")
            (provision "bonfire")
            (requirement '(db)))
          (oci-container-configuration
            (image "nginx:stable-alpine3.23-perl")
            (ports '("80:80" "443:443"))
            (provision "nginx")
            (requirement '(bonfire)))))
  (networks
    (list (oci-network-configuration (name "bonfire")))))

You can copy this add into your configuration with a simple-service, like it's shown in the manual in the above link.

Running guix compose from the main branch

If you have direnv command configured on your system, then you can enter the repository root and have an environment set up for you by direnv. Otherwise, once you are in the project root, you can set the following environment variables to run guix compose from sources:

eval "$(guix shell -m manifest.scm -D -f guix.scm --search-paths)"
export GUILE_LOAD_PATH="$(realpath src/):${GUILE_LOAD_PATH}"
export GUIX_EXTENSIONS_PATH="$(realpath src/guix/extensions):${GUIX_EXTENSIONS_PATH}"

Either way, now, you should be able to run the guix compose command from sources with:

guix compose --help

...

Usage: guix compose COMMAND [OPTION] FILE...
Provide a docker-compose.yml compatibility layer for Guix.

Available commands:

    import    generate Guix native configurations from a docker-compose.yml

  --canonicalize-paths   convert all referenced relative paths to absolute
  --env-file             specify an alternate environment file

  -h, --help             display this help and exit
  -V, --version          display version information and exit

  -v, --verbosity=LEVEL  use the given verbosity LEVEL

Please report bugs to https://codeberg.org/fishinthecalculator/guix-compose/issues .

Guix channel

To configure Guix for using this repository as a channel, you need to create a .config/guix/channels.scm file with the following content:

(cons* (channel
        (name 'compose)
        (url "https://codeberg.org/fishinthecalculator/guix-compose.git")
        (branch "main")
        ;; Enable signature verification:
        (introduction
         (make-channel-introduction
          "770b90897bde036329bdb325e5eb1c16c34e985d"
          (openpgp-fingerprint
           "8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2"))))
       %default-channels)

Otherwise, if you already have a .config/guix/channels.scm you can simply prepend this channel to the preexisting ones:

(cons* (channel
        (name 'compose)
        (url "https://codeberg.org/fishinthecalculator/guix-compose.git")
        (branch "main")
        ;; Enable signature verification:
        (introduction
         (make-channel-introduction
          "770b90897bde036329bdb325e5eb1c16c34e985d"
          (openpgp-fingerprint
           "8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2"))))
       (channel
        (name 'nonguix)
        (url "https://gitlab.com/nonguix/nonguix")
        ;; Enable signature verification:
        (introduction
         (make-channel-introduction
          "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
          (openpgp-fingerprint
           "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
       %default-channels)

What is a Guix channel?

A channel is roughly the Guix equivalent of the AUR or container registries. It's a software repository providing Guix package and service definitions.

Contributing

All contributions are welcome. If you have commit access please remember to setup the authentication hook with

guix git authenticate --cache-key=channels/guix-compose --stats 770b90897bde036329bdb325e5eb1c16c34e985d "8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2"

License

Unless otherwise stated all the files in this repository are to be considered under the GPL 3.0 terms. You are more than welcome to open issues or send patches.