Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use absolute paths for custom Procfile in a Docker image #6982

Open
polettix opened this issue Jul 7, 2024 · 1 comment
Open

Cannot use absolute paths for custom Procfile in a Docker image #6982

polettix opened this issue Jul 7, 2024 · 1 comment

Comments

@polettix
Copy link
Contributor

polettix commented Jul 7, 2024

Description of problem

NOTE: this might end up being just a documentation issue, although I'd like it to behave differently.

I have a Docker image whose Work Dir is set to /mnt and the whole application is in /app, including /app/Procfile.

The defaults settings go looking for Procfile in /mnt and this fails, of course. I thought that setting this would solve the problem:

dokku ps:set test-app procfile-path /app/Procfile

but it still failed.

The example uses a relative path .dokku/Procfile and that indeed works when doing this:

dokku ps:set test-app procfile-path ../app/Procfile

IMHO it should be possible to set absolute paths when dealing with pre-built Docker images, but in case it's better not I'd suggest to make it explicit in the docs.

Steps to reproduce

Use image registry.gitlab.com/polettix/xmpl:20240707-145404-3073983 for a test-app and set:

dokku ps:set test-app procfile-path /app/Procfile

dokku report $APP_NAME

-----> uname: Linux dokku-test 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux
-----> memory:
                      total        used        free      shared  buff/cache   available
       Mem:             961         415         134           3         572         545
       Swap:              0           0           0
-----> disk utilization:
       Filesystem      Size  Used Avail Use% Mounted on
       /dev/vda1        25G  4.1G   20G  18% /
       /dev/vda15      124M   12M  113M  10% /boot/efi
-----> disk inode utilization:
       Filesystem     Inodes IUsed IFree IUse% Mounted on
       /dev/vda1        1.6M   88K  1.5M    6% /
       /dev/vda15          0     0     0     - /boot/efi
-----> docker version:
       Client: Docker Engine - Community
        Version:           27.0.3
        API version:       1.46
        Go version:        go1.21.11
        Git commit:        7d4bcd8
        Built:             Sat Jun 29 00:02:50 2024
        OS/Arch:           linux/amd64
        Context:           default

       Server: Docker Engine - Community
        Engine:
         Version:          27.0.3
         API version:      1.46 (minimum version 1.24)
         Go version:       go1.21.11
         Git commit:       662f78c
         Built:            Sat Jun 29 00:02:50 2024
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.7.18
         GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
        runc:
         Version:          1.7.18
         GitCommit:        v1.1.13-0-g58aa920
        docker-init:
         Version:          0.19.0
         GitCommit:        de40ad0
-----> docker daemon info:
       Client: Docker Engine - Community
        Version:    27.0.3
        Context:    default
        Debug Mode: true
        Plugins:
         buildx: Docker Buildx (Docker Inc.)
           Version:  v0.15.1
           Path:     /usr/libexec/docker/cli-plugins/docker-buildx
         compose: Docker Compose (Docker Inc.)
           Version:  v2.28.1
           Path:     /usr/libexec/docker/cli-plugins/docker-compose

       Server:
        Containers: 2
         Running: 1
         Paused: 0
         Stopped: 1
        Images: 5
        Server Version: 27.0.3
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Using metacopy: false
         Native Overlay Diff: true
         userxattr: false
        Logging Driver: json-file
        Cgroup Driver: systemd
        Cgroup Version: 2
        Plugins:
         Volume: local
         Network: bridge host ipvlan macvlan null overlay
         Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
        Swarm: inactive
        Runtimes: runc io.containerd.runc.v2
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
        runc version: v1.1.13-0-g58aa920
        init version: de40ad0
        Security Options:
         apparmor
         seccomp
          Profile: builtin
         cgroupns
        Kernel Version: 6.1.0-9-amd64
        Operating System: Debian GNU/Linux 12 (bookworm)
        OSType: linux
        Architecture: x86_64
        CPUs: 1
        Total Memory: 961MiB
        Name: dokku-test
        ID: bc3eb9c8-3a26-43f2-b000-b7c79504deeb
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
         File Descriptors: 45
         Goroutines: 48
         System Time: 2024-07-07T15:29:33.828974211Z
         EventsListeners: 0
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> herokuish version:
       herokuish: v0.9.2
       buildpacks:
         heroku-buildpack-multi     v1.2.0
         heroku-buildpack-ruby      v272
         heroku-buildpack-nodejs    v254
         heroku-buildpack-clojure   v91
         heroku-buildpack-python    v252
         heroku-buildpack-java      v73
         heroku-buildpack-gradle    v39
         heroku-buildpack-scala     v98
         heroku-buildpack-play      v26
         heroku-buildpack-php       v253
         heroku-buildpack-go        v192
         heroku-buildpack-nginx     v25
         buildpack-null             v3
-----> dokku version: dokku version 0.34.6
-----> dokku-event-listener version: v0.17.0
-----> dokku-update version: dokku-update v0.9.4
-----> docker-container-healthchecker version: v0.11.0
-----> docker-image-labeler version: v0.8.0
-----> git version: git version 2.39.2
-----> lambda-builder version:        v0.8.0
-----> netrc version: v0.10.0
 !     pack binary is not available
-----> plugn version: plugn: v0.16.0
-----> sigil version: v0.11.0
-----> sshcommand version: sshcommand v0.18.0
-----> dokku plugins:
         00_dokku-standard    0.34.6 enabled    dokku core standard plugin
         20_events            0.34.6 enabled    dokku core events logging plugin
         app-json             0.34.6 enabled    dokku core app-json plugin
         apps                 0.34.6 enabled    dokku core apps plugin
         builder              0.34.6 enabled    dokku core builder plugin
         builder-dockerfile   0.34.6 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.34.6 enabled    dokku core builder-herokuish plugin
         builder-lambda       0.34.6 enabled    dokku core builder-lambda plugin
         builder-nixpacks     0.34.6 enabled    dokku core builder-nixpacks plugin
         builder-null         0.34.6 enabled    dokku core builder-null plugin
         builder-pack         0.34.6 enabled    dokku core builder-pack plugin
         buildpacks           0.34.6 enabled    dokku core buildpacks plugin
         caddy-vhosts         0.34.6 enabled    dokku core caddy-vhosts plugin
         certs                0.34.6 enabled    dokku core certificate management plugin
         checks               0.34.6 enabled    dokku core checks plugin
         common               0.34.6 enabled    dokku core common plugin
         config               0.34.6 enabled    dokku core config plugin
         cron                 0.34.6 enabled    dokku core cron plugin
         docker-options       0.34.6 enabled    dokku core docker-options plugin
         domains              0.34.6 enabled    dokku core domains plugin
         enter                0.34.6 enabled    dokku core enter plugin
         git                  0.34.6 enabled    dokku core git plugin
         haproxy-vhosts       0.34.6 enabled    dokku core haproxy-vhosts plugin
         logs                 0.34.6 enabled    dokku core logs plugin
         network              0.34.6 enabled    dokku core network plugin
         nginx-vhosts         0.34.6 enabled    dokku core nginx-vhosts plugin
         openresty-vhosts     0.34.6 enabled    dokku core openresty-vhosts plugin
         plugin               0.34.6 enabled    dokku core plugin plugin
         ports                0.34.6 enabled    dokku core ports plugin
         proxy                0.34.6 enabled    dokku core proxy plugin
         ps                   0.34.6 enabled    dokku core ps plugin
         registry             0.34.6 enabled    dokku core registry plugin
         repo                 0.34.6 enabled    dokku core repo plugin
         resource             0.34.6 enabled    dokku core resource plugin
         run                  0.34.6 enabled    dokku core run plugin
         scheduler            0.34.6 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.34.6 enabled    dokku core scheduler-docker-local plugin
         scheduler-k3s        0.34.6 enabled    dokku core scheduler-k3s plugin
         scheduler-null       0.34.6 enabled    dokku core scheduler-null plugin
         shell                0.34.6 enabled    dokku core shell plugin
         ssh-keys             0.34.6 enabled    dokku core ssh-keys plugin
         storage              0.34.6 enabled    dokku core storage plugin
         trace                0.34.6 enabled    dokku core trace plugin
         traefik-vhosts       0.34.6 enabled    dokku core traefik-vhosts plugin
=====> test-app app-json information
       App json computed selected:    app.json
       App json global selected:      app.json
       App json selected:
=====> test-app app information
       App created at:                1720299486
       App deploy source:             docker-image
       App deploy source metadata:    registry.gitlab.com/polettix/xmpl:20240707-145404-3073983
       App dir:                       /home/dokku/test-app
       App locked:                    false
=====> test-app builder information
       Builder build dir:
       Builder computed build dir:
       Builder computed selected:
       Builder global build dir:
       Builder global selected:
       Builder selected:
=====> test-app builder-dockerfile information
       Builder dockerfile computed dockerfile path: Dockerfile
       Builder dockerfile global dockerfile path: Dockerfile
       Builder dockerfile dockerfile path:
=====> test-app builder-herokuish information
       Builder herokuish computed allowed: true
       Builder herokuish global allowed: true
       Builder herokuish allowed:
=====> test-app builder-lambda information
       Builder lambda computed lambdayml path: lambda.yml
       Builder lambda global lambdayml path: lambda.yml
       Builder lambda lambdayml path:
=====> test-app builder-nixpacks information
       Builder nixpacks computed nixpackstoml path: nixpacks.toml
       Builder nixpacks global nixpackstoml path: nixpacks.toml
       Builder nixpacks nixpackstoml path:
       Builder nixpacks computed no cache: false
       Builder nixpacks global no cache: false
       Builder nixpacks no cache:
=====> test-app builder-pack information
       Builder pack computed projecttoml path: project.toml
       Builder pack global projecttoml path: project.toml
       Builder pack projecttoml path:
=====> test-app buildpacks information
       Buildpacks computed stack:     gliderlabs/herokuish:latest-22
       Buildpacks global stack:
       Buildpacks list:
       Buildpacks stack:
=====> test-app caddy information
       Caddy image:                   lucaslorentz/caddy-docker-proxy:2.9
       Caddy letsencrypt email:
       Caddy letsencrypt server:      https://acme-v02.api.letsencrypt.org/directory
       Caddy log level:               ERROR
       Caddy polling interval:        5s
       Caddy tls internal:            false
=====> test-app ssl information
       Ssl dir:                       /home/dokku/test-app/tls
       Ssl enabled:                   false
       Ssl hostnames:
       Ssl expires at:
       Ssl issuer:
       Ssl starts at:
       Ssl subject:
       Ssl verified:
=====> test-app checks information
       Checks disabled list:          none
       Checks skipped list:           none
       Checks computed wait to retire: 60
       Checks global wait to retire:  60
       Checks wait to retire:
=====> test-app docker options information
       Docker options build:
       Docker options deploy:         --restart=on-failure:10
       Docker options run:
=====> test-app domains information
       Domains app enabled:           true
       Domains app vhosts:            test-app.polettix.xyz
       Domains global enabled:        true
       Domains global vhosts:         polettix.xyz
=====> test-app git information
       Git deploy branch:             master
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:                       f5896b05bd7ae5a3fbf70eceb51adf1be6b720da
       Git source image:              registry.gitlab.com/polettix/xmpl:20240707-144614-3068303
       Git last updated at:           1720365702
=====> test-app haproxy information
       Haproxy image:                 byjg/easy-haproxy:4.4.0
       Haproxy letsencrypt email:
       Haproxy letsencrypt server:    https://acme-v02.api.letsencrypt.org/directory
       Haproxy log level:             ERROR
=====> test-app logs information
       Logs computed max size:        10m
       Logs global max size:          10m
       Logs global vector sink:
       Logs max size:
       Logs vector global image:      timberio/vector:0.39.0-debian
       Logs vector sink:
=====> test-app network information
       Network attach post create:
       Network attach post deploy:
       Network bind all interfaces:          false
       Network computed attach post create:
       Network computed attach post deploy:
       Network computed bind all interfaces: false
       Network computed initial network:
       Network computed tld:
       Network global attach post create:
       Network global attach post deploy:
       Network global bind all interfaces:   false
       Network global initial network:
       Network global tld:
       Network initial network:
       Network static web listener:
       Network tld:
       Network web listeners:                172.17.0.3:5000
=====> test-app nginx information
       Nginx access log format:
       Nginx computed access log format:
       Nginx global access log format:
       Nginx access log path:
       Nginx computed access log path: /var/log/nginx/test-app-access.log
       Nginx global access log path:  /var/log/nginx/test-app-access.log
       Nginx bind address ipv4:
       Nginx computed bind address ipv4:
       Nginx global bind address ipv4:
       Nginx bind address ipv6:
       Nginx computed bind address ipv6: ::
       Nginx global bind address ipv6: ::
       Nginx client max body size:
       Nginx computed client max body size: 1m
       Nginx global client max body size: 1m
       Nginx disable custom config:
       Nginx computed disable custom config: false
       Nginx global disable custom config: false
       Nginx error log path:
       Nginx computed error log path: /var/log/nginx/test-app-error.log
       Nginx global error log path:   /var/log/nginx/test-app-error.log
       Nginx hsts include subdomains:
       Nginx computed hsts include subdomains: true
       Nginx global hsts include subdomains: true
       Nginx hsts max age:
       Nginx computed hsts max age:   15724800
       Nginx global hsts max age:     15724800
       Nginx hsts preload:
       Nginx computed hsts preload:   false
       Nginx global hsts preload:     false
       Nginx hsts:
       Nginx computed hsts:           true
       Nginx global hsts:             true
       Nginx last visited at:
       Nginx nginx conf sigil path:
       Nginx computed nginx conf sigil path: nginx.conf.sigil
       Nginx global nginx conf sigil path: nginx.conf.sigil
       Nginx proxy buffer size:
       Nginx computed proxy buffer size: 4k
       Nginx global proxy buffer size: 4k
       Nginx proxy buffering:
       Nginx computed proxy buffering: on
       Nginx global proxy buffering:  on
       Nginx proxy buffers:
       Nginx computed proxy buffers:  8 4k
       Nginx global proxy buffers:    8 4k
       Nginx proxy busy buffers size:
       Nginx computed proxy busy buffers size: 8k
       Nginx global proxy busy buffers size: 8k
       Nginx proxy read timeout:
       Nginx computed proxy read timeout: 60s
       Nginx global proxy read timeout: 60s
       Nginx underscore in headers:
       Nginx computed underscore in headers: off
       Nginx global underscore in headers: off
       Nginx x forwarded for value:
       Nginx computed x forwarded for value: $remote_addr
       Nginx global x forwarded for value: $remote_addr
       Nginx x forwarded port value:
       Nginx computed x forwarded port value: $server_port
       Nginx global x forwarded port value: $server_port
       Nginx x forwarded proto value:
       Nginx computed x forwarded proto value: $scheme
       Nginx global x forwarded proto value: $scheme
       Nginx x forwarded ssl:
       Nginx computed x forwarded ssl:
       Nginx global x forwarded ssl:
=====> test-app openresty information
       Openresty access log format:
       Openresty access log path:     /var/log/nginx/test-app-access.log
       Openresty allowed letsencrypt domains func base64: cmV0dXJuIHRydWUK
       Openresty bind address ipv4:
       Openresty bind address ipv6:   ::
       Openresty client max body size:
       Openresty error log path:      /var/log/nginx/test-app-error.log
       Openresty global hsts:         true
       Openresty computed hsts:       true
       Openresty hsts:
       Openresty hsts include subdomains: true
       Openresty hsts max age:        15724800
       Openresty hsts preload:        false
       Openresty image:               dokku/openresty-docker-proxy:0.8.0
       Openresty letsencrypt email:
       Openresty letsencrypt server:  https://acme-v02.api.letsencrypt.org/directory
       Openresty proxy buffer size:   4k
       Openresty proxy buffering:     on
       Openresty proxy buffers:       8 4k
       Openresty proxy busy buffers size: 8k
       Openresty proxy read timeout:  60s
       Openresty underscore in headers: off
       Openresty x forwarded for value: $remote_addr
       Openresty x forwarded port value: $server_port
       Openresty x forwarded proto value: $scheme
       Openresty x forwarded ssl:
=====> test-app ports information
       Ports map:
       Ports map detected:            http:80:5000
=====> test-app proxy information
       Proxy computed type:           nginx
       Proxy enabled:                 true
       Proxy global type:             nginx
       Proxy type:
=====> test-app ps information
       Deployed:                      true
       Processes:                     1
       Ps can scale:                  true
       Ps computed procfile path:     /app/Procfile
       Ps global procfile path:       Procfile
       Ps procfile path:              /app/Procfile
       Ps restart policy:             on-failure:10
       Restore:                       true
       Running:                       true
       Status web 1:                  running (CID: d22178cac40)
=====> test-app registry information
       Registry computed image repo:        dokku/test-app
       Registry computed push on release:   false
       Registry computed server:
       Registry global image repo template:
       Registry global push on release:
       Registry global server:
       Registry image repo:
       Registry push extra tags:
       Registry push on release:
       Registry server:
       Registry tag version:
=====> test-app resource information
=====> test-app scheduler information
       Scheduler computed selected:   docker-local
       Scheduler global selected:     docker-local
       Scheduler selected:
=====> test-app scheduler-docker-local information
       Scheduler docker local init process: true
       Scheduler docker local parallel schedule count:
=====> test-app scheduler-k3s information
       Scheduler k3s computed deploy timeout:       300s
       Scheduler k3s computed image pull secrets:
       Scheduler k3s computed letsencrypt server:   prod
       Scheduler k3s computed namespace:            default
       Scheduler k3s computed rollback on failure:  false
       Scheduler k3s deploy timeout:
       Scheduler k3s global deploy timeout:         300s
       Scheduler k3s global image pull secrets:
       Scheduler k3s global ingress class:          nginx
       Scheduler k3s global kube context:
       Scheduler k3s global kubeconfig path:        /etc/rancher/k3s/k3s.yaml
       Scheduler k3s global letsencrypt email prod:
       Scheduler k3s global letsencrypt email stag:
       Scheduler k3s global letsencrypt server:     prod
       Scheduler k3s global namespace:              default
       Scheduler k3s global network interface:      eth0
       Scheduler k3s global rollback on failure:    false
       Scheduler k3s image pull secrets:
       Scheduler k3s letsencrypt server:
       Scheduler k3s namespace:
       Scheduler k3s rollback on failure:
=====> test-app storage information
       Storage build mounts:
       Storage deploy mounts:
       Storage run mounts:
=====> test-app traefik information
       Traefik api enabled:           false
       Traefik api vhost:             traefik.dokku.me
       Traefik basic auth password:
       Traefik basic auth username:
       Traefik dashboard enabled:     false
       Traefik image:                 traefik:2.11.2
       Traefik letsencrypt email:
       Traefik letsencrypt server:    https://acme-v02.api.letsencrypt.org/directory
       Traefik log level:             ERROR
       Traefik http entry point:      http
       Traefik https entry point:     https

Additional information

Procfile just passes the right command to the entrypoint, which is a Perl app supporting sub-commands (like daemon):

web: daemon -l 'http://*:5000'

The output just makes it clear that the application is being called without the parameters in the Procfile.

The Docker image was produced with a succession of docker commands and not directly from a Dockerfile, so it does not make sense to put it here.

Output of failing commands after running: dokku trace:off

No response

Output of failing commands after running: dokku trace:on

No response

@josegonzalez
Copy link
Member

Yeah this is by design - the path is always relative to the WORKDIR. I would definitely take a PR to make the documentation more explicit here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants