runner icon indicating copy to clipboard operation
runner copied to clipboard

Provide option to specify arguments for container jobs and services

Open seanyoung opened this issue 4 years ago • 3 comments

When specifying service containers for a jobs, sometimes it is necessary to add command line arguments to the container. See this example: https://github.community/t/how-do-i-properly-override-a-service-entrypoint/17435. Here it is useful to add --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 to the container start command line.

These arguments are simply passed after the image name on the docker create command line.

Here is another example of trying to add command line arguments to postgres: https://stackoverflow.com/questions/65438055/how-to-add-config-args-to-postgres-service-container-in-github-action

The options field cam be used to change the entrypoint of a container, but it is not possible to change the arguments.

Please let me know what else is required to make this mergable, thank you.

seanyoung avatar Jun 12 '21 10:06 seanyoung

Another example is parity substrate. This container requires an argument, else an error is returned:

docker run --rm -it parity/substrate:latest
Error: Input("Please specify which chain you want to run, e.g. --dev or --chain=local")

vs

docker run --rm -it parity/substrate:latest --dev
2021-06-12 16:56:39  Running in --dev mode, RPC CORS has been disabled.    
2021-06-12 16:56:39  Substrate Node    
...

So without being able to add any arguments, it's impossible to have substrate as a service.

seanyoung avatar Jun 12 '21 16:06 seanyoung

bumping this in case it moves it up the queue

in many cases, the 'local emulator' image for key cloud services can only be configured with command line parameters. this is a primary use-case for the services feature of actions

a user can work around that by building their own image with an overridden CMD/ENTRYPOINT, but it would be so much better for actions to expose this ability directly; it is core docker functionality

there are multiple requests for this out in the wild:

  • https://github.com/actions/runner/issues/2276
  • https://github.com/actions/runner/discussions/1872
  • https://github.com/orgs/community/discussions/26688 override a service entrypoint

gitlab has had this for decades: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image

abe-winter avatar Apr 27 '24 19:04 abe-winter

Hello,

Building, and Maintaining custom images everytime we want to pass a specific entrypoint is extremely painful.

Any news regarding the merge of this PR for passing custom CMD/entrypoints to container services?

Blizter avatar Sep 12 '24 14:09 Blizter