Container entrypoint not loading

My docker image has a custom entrypoint which loads some environment variables (and also prints a debug message). It looks like this entrypoint is not being loaded in the action run. (https://github.com/lobis/docker-root-geant4-garfield/runs/5066687301?check_suite_focus=true).

$ docker run -it ghcr.io/lobis/root-geant4-garfield:latest /bin/sh
ENTRYPOINT DEBUG
#

I think the entrypoint is defined correctly, you can see the Dockerfile in https://github.com/lobis/docker-root-geant4-garfield/blob/07d49d27099f932bf24cf37f939d79a692b1dc67/Dockerfile.

I know I could call the entrypoint manually in every step, but this seems too verbose and I would like to avoid it.

Also I could define these environment variables manually in the Dockerfile, however this is not practical because depending on the version of the dependencies, these env variables can change. I don’t think it is possible to define an env variable from the inside of a Dockerfile using the result of some other command. I need to define them via ENV which requires me to know the name of the variable beforehand. If this was possible it would also fix my problem. I think its impossible but it would be my preferred choice.

Thanks!

The Actions runner overrides the entrypoint with “tail” when starting the job container, as you can see here: https://github.com/lobis/docker-root-geant4-garfield/runs/5066687301?check_suite_focus=true#step:2:104

As far as I know that’s by design, the container is simply used as a prepared filesystem for the job. The easiest thing would probably be to create a script that writes the environment variables your entrypoint is supposed to set to GITHUB_ENV and run that as the first step of the workflow.