while running this code using command

docker-compose up

"docker-compose.yml"

version: '3.4' 

services: 
    employee-registry: 
        build: . 
        volumes: 
            - .:/usr/src/app 

I am getting error as

Building employee-registry ERROR: Cannot locate specified Dockerfile: Dockerfile

I have checked it as valid yaml. if i include dockerfile: Dockerfile and context . as well than i am getting "mapping error"

I have tried several methods after searching on internet but none of them working.

"Dockerfile"

FROM python:3

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "python", "./run.py" ]

Note:- requirements.txt is empty file and all the four files (Dockerfile,docker-compose.yml,requirements.txt,run.py) are in same directory.

Edit - I created Dockerfile without extension but still it was taking .txt format. I removed that manually. Now i am getting this error. "ERROR: for employee-registry Cannot create container for service employee-registry: b'Drive has not been shared' ERROR: Encountered errors while bringing up the project."

I know it's not a good question

0 Answers