Error response from daemon: failed to create symlink: [...] file exists with Docker and Mutagen

209 views Asked by At

I am using two different docker setups for the same project, one for the local development and one for the pipelines. The difference is, that I am using mutagen for local development, to keep everything in sync. Given the following simplified configuration:

LOCAL

volumes:
    application: ~
    vendor-data: ~

services:
    php-fpm:
        // ...
        volumes:
            - 'application:/var/www/html:cached'
            - 'vendor-data:/var/www/html/vendor'

x-mutagen:
    sync:
        defaults:
            ignore:
                vcs: true
                paths:
                    - 'vendor'
        application:
            alpha: './application'
            beta: 'volume://application'
        vendor-data:
            alpha: './application/vendor'
            beta: 'volume://vendor-data'

I am overwriting the local docker-compose file with this one for the pipelines:

volumes:
    vendor-data: ~

services:
    php-cron:
        volumes:
            - './application:/var/www/html:cached' // use local files instead of volume
            - 'vendor-data:/var/www/html/vendor'

    php-fpm:
        volumes:
            - './application:/var/www/html:cached' // use local files instead of volume
            - 'vendor-data:/var/www/html/vendor'

For local development, everything works just fine. But I am getting this error in the pipelines:

Error response from daemon: failed to mkdir /var/lib/docker/volumes/vendor-data/_data/aws: mkdir /var/lib/docker/volumes/vendor-data/_data/aws: file exists

I think the problem has to do with the fact that the image already contains application and vendor files, but I want to overwrite them with the ones in local development and the pipelines.

0

There are 0 answers