Search code examples
dockerdocker-composeargs

Docker can't use args in docker-compose (use args from .env)


i want to pass some args i define in my .env file to the build process of my container

.env file:

OS_USER_UID=999

docker-compose:

  app:
    build: .
    args:
      - OS_USER_UID=$OS_USER_UID

but this alsways results in:

Unsupported config option for services.app: 'args'

Why that? Can't i just use vars i define in .env as build variables?


Solution

  • @samthegolden: Yes that helped, merci :)

    app:
        build:
          context: .
          args:
            - OS_USER