Skip to content

Allow passing arguments to the docker image as env var #87043

@dvarrazzo

Description

@dvarrazzo

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:26257

I 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-systemC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityT-dev-inf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions