-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Allow passing arguments to the docker image as env var #87043
Description
The Github Actions system allows to run services to support CI jobs.
I haven't been able to use CockroachDB as a job service because, in order to run a database, the image requires certain arguments, for instance:
docker run --rm --name crdb -p 26257:26257 cockroachdb/cockroach:v21.2.14 start-single-node --insecure
Gitlab CI doesn't seem to allow to specify args. This is arguably a shortcoming of theirs and it would be nice if they improved Actions, but, in the meantime CockroachDB could make use of Action services if it was possible to specify the arguments as an env var. For instance, if specifying CRDB_ARGS was equivalent to starting the container with /cockroach/cockroach.sh $CRDB_ARGS then it would be possible to use Github Actions using an entry such as:
services:
crdb:
image: cockroachdb/cockroach:latest-v22.1
env:
CRDB_ARGS: start-single-node --insecure
ports:
- 26257:26257I don't know if there are hacks I haven't considered to kick Actions into running a container with args, I couldn't find anything by googling and reading docker run --help.
Of course an optimal solution was for Github to extend their service syntax but that would likely take longer than adding the feature to your cockroach.sh.
Jira issue: CRDB-19119