Docker version 1.12.1, build 23cf638, experimental
docker-compose version 1.8.0, build f3628c7
I’m attempting to get a docker-compose file working that uses the ARGs option along with the image option.
ERROR: The Compose file './docker-compose.yml' is invalid because: services.db.build contains unsupported option: 'image'
Here is the relevant part of my compose file:
1 version: '2' 2 services: 3 db: 4 build: 5 image: postgres:9.4.1 6 args: 7 POSTGRES_USER: 'special_user' 8 volumes: 9 - postgres:/var/lib/postgresql/data
Here in the docs, it seems to say you CAN use image with build, but it’s about creating an image not using one.
Can I somehow use ARGS along with an image in the compose file? The usecase for this is, that the postgres image uses
onbuild or something, and requires build time variables to be entered in. So I can’t get the user to be created when I do
docker-compose build db