I believe the GitLab CI entrypoint behaviour boils down to OCI
configuration, compare Debian's image:

skopeo inspect --config docker://debian:12
...
    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
            "bash"
        ]
    },

The images I generate via 'guix pack':

skopeo inspect --config 
docker://registry.gitlab.com/debdistutils/guix/container:stage1
...
    "config": {
        "Env": [
            "PATH=/gnu/store/5n0rm83hn6xwf57iwlrn6sfcr5bfjdv3-profile/bin"
        ]
    },

Using `guix pack --entry-point` changes it into:

    "config": {
        "Env": [
            "PATH=/gnu/store/0plsn32m4xzv4i9ixbx02d42nhbw5hx6-profile/bin"
        ],
        "Entrypoint": [
            "/gnu/store/0plsn32m4xzv4i9ixbx02d42nhbw5hx6-profile/bash"
        ]
    },

However if we want the same behaviour as the debian:12 container image,
we want to set "Cmd" instead of "Entrypoint".

I found the code for this in guix/docker.scm and guix/scripts/pack.scm
but making changes this deep down is beyond me right now.  Help?

IMHO the best would be if Guix container images looked like this:

    "config": {
        "Env": [
            "PATH=/gnu/store/5n0rm83hn6xwf57iwlrn6sfcr5bfjdv3-profile/bin"
        ],
        "Cmd": [
            "bash"
        ]
    },

Comparing some other well-known images, fedora:42 has:

    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "DISTTAG=f42container",
            "FGC=f42",
            "FBR=f42"
        ],
        "Cmd": [
            "/bin/bash"
        ],
        "WorkingDir": "/",
        "Labels": {
            "maintainer": "Clement Verna \u003ccve...@fedoraproject.org\u003e"
        }
    },

AlmaLinux:8 and AlmaLinux:9 has:

    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
            "/bin/bash"
        ],
        "WorkingDir": "/"
    },

Alpine:latest has:

    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
            "/bin/sh"
        ],
        "WorkingDir": "/"
    },

ArchLinux:latest has:

    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "LANG=C.UTF-8"
        ],
        "Cmd": [
            "/usr/bin/bash"
        ],
        "WorkingDir": "/",

Ubuntu:24.04 has:

    "config": {
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
            "/bin/bash"
        ],

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to