Mapping volume related with WORKDIR

Viewed 4116

How can I map a volume using the Image WORKDIR in docker-compose?

I'm trying to use

services:
    my-app:
        image: <image>
        volumes:
            - ./scripts:./scripts

But when I try to execute docker-compose up -d, I get the error bellow:

Cannot create container for service my-app: invalid volume spec "scripts": invalid volume specification: 'scripts': invalid mount config for type "volume": invalid mount path: 'scripts' mount path must be absolute

Is there any way to map my scripts folder in the WORKDIR of a image without knowing where is this folder?

1 Answers
Related