DobreMihaela
DobreMihaela

Reputation: 194

Docker compose runtime arguments

I want to pass the runtime arguments from docker run .... --arg=x inside docker-compose.yml

version: "2.8"
services:
  atlantis:
    build:
      context: ./
      dockerfile: Dockerfile
    environment:
       gitlab-hostname: "X"
       gitlab-webhook-secret: "X"
       gitlab-user: "X"
       gitlab-token: "X"
       repo-allowlist: "X"
    ports:
      - "4141:8081"
    image: "runatlantis/atlantis"

It seems that it doesn't work: atlantis_1 | Error: --gh-user/--gh-token or --gh-app-id/--gh-app-key-file or --gitlab-user/--gitlab-token or --bitbucket-user/--bitbucket-token or --azuredevops-user/--azuredevops-token must be set

Any ideas?

Upvotes: 1

Views: 985

Answers (1)

Mafor
Mafor

Reputation: 10681

Use command instead of environment:

version: "3"

services:
  atlantis:
    build:
      context: ./
      dockerfile: Dockerfile
    ports:
      - "4141:8081"
    image: "runatlantis/atlantis-custom"
    command: 
      - server
      - --gitlab-hostname="X"
      - --gitlab-webhook-secret="X"
      - --gitlab-user="X"
      - --gitlab-token="X"
      - --repo-allowlist="X"

Upvotes: 1

Related Questions