7

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?

  • 6
    According to the [documentation](https://docs.docker.com/compose/compose-file/#args) `args` should be defined inside `build` and with a `context` key to set the path. – samthegolden Jan 27 '20 at 15:55

1 Answers1

10

@samthegolden: Yes that helped, merci :)

app:
    build:
      context: .
      args:
        - OS_USER