img icon indicating copy to clipboard operation
img copied to clipboard

docker-compose support

Open henres opened this issue 5 years ago • 1 comments

Hello here, thanks for your great works !

In our CI we use docker-compose to build our images. Will it be possible to make something like this : img build -docker-compose-file mon-docker-compose.yaml

For example in one of our docker-compose.yaml for build :

version: '3.5'
services:
    php_fpm:
        image: "private_registry/project-x/php-fpm${SUB_REGISTRY}:${VERSION_TAG:?}"
        build:
            context: "./php-fpm"
            args:
                APP_VERSION: "${APP_TAG:?}"
                ENABLE_BLACKFIRE: 'false'
                ENABLE_XDEBUG: 'false'
                SSH_PRIVATE_KEY: '${SSH_PRIVATE_KEY:?}'
                CLONE_REPOSITORY: 'private_repository/project-x.git'
                CLONE_BRANCH: '${CLONE_BRANCH:?}'
                YARN_COMMAND: '${YARN_COMMAND:?}'
                SERVER_ENV: '${SERVER_ENV:?}'
                SYMFONY_ENV: '${SYMFONY_ENV:?}'

    nginx:
        image: "private_registry/project-x//nginx${SUB_REGISTRY}:${VERSION_TAG:?}"
        build:
            context: "./nginx"
            args:
                APP_VERSION: "${APP_TAG:?}"
                BUILD_TAG: "${VERSION_TAG:?}"
                SUB_REGISTRY_FOLDER: "${SUB_REGISTRY:?}"
        depends_on:
            - "php_fpm"

It works great for dependencies !

Have a nice week !

henres avatar Mar 23 '20 08:03 henres

We're in the same boat. We have a single docker-compose.yaml that defines our build and pushes tagged images. It also fires up the stack for local development. Very neat, because there's a single source of truth, and we run the same docker-compose build in GCB. Simple and repeatable.

The only downside is that we can't use the IMG

abdennour avatar Jan 21 '21 17:01 abdennour