Unable to provide command-line arguments to runner service containers
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
Description
Describe the enhancement
I would like to be able to provide command-line arguments to a service container.
Code Snippet
docker-compose currently handles this with the command directive:
version: "3"
services:
keycloak:
image: quay.io/keycloak/keycloak:19.0.2
command: start-dev --features=preview
environment:
- KEYCLOAK_ADMIN=keycloak
- KEYCLOAK_ADMIN_PASSWORD=password
- KC_LOG_LEVEL=INFO
- KC_DB=dev-mem
ports:
- 8080:8080
The API for actions could look like this:
jobs:
test:
services:
keycloak:
image: quay.io/keycloak/keycloak:19.0.2
ports:
- 8080:8080
env:
KC_DB: dev-mem
KC_LOG_LEVEL: INFO
KEYCLOAK_ADMIN: keycloak
KEYCLOAK_ADMIN_PASSWORD: password
command: start-dev --features=preview
Additional information
If you're working with a docker image that only specifies a script as the ENTRYPOINT, then there is no feasible way to use this image as a service container within GitHub Actions if you need to specify additional arguments. Here's a list of everything I tried:
- I tried using
optionsto set the--entrypointflag when starting the container, but that doesn't work when trying to set arguments for the entrypoint script. - I tried putting a script into my repository that would run the command with the arguments I want, that I could then mount to the service container as a volume. This doesn't work because the volume mount would happen before my repository code is cloned down within the workflow.
Right now, the only possible workaround is for me to build and push my own container that uses my desired container as a base, and overrides the ENTRYPOINT to specify the arguments I want. This is not a good long-term solution, as my test suite runs on three different versions of this software, so I need to maintain three different containers that have this fix.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by tracing how the runner creates Docker service containers and passes existing options to the container invocation. Done means a workflow service can declare command-line arguments like the proposed command field and the behavior is covered by runner tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker, github-actions
- Domain
- ci-cd, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100