Docker: Error response from daemon: error while creating mount source path '/bdd': mkdir /bdd: read-only file system

Hello,

Terminal :

$ sudo docker run --name api -d -p 8080:8080 -v ${pwd}/bdd:/usr/src/app api
→ 78640cfa15f0025bf39b7b684f563caaf687ea8b5ac7206ac5436871ad391b00
docker: Error response from daemon: error while creating mount source path ‘/bdd’: mkdir /bdd: read-only file system.

Dockerfile :

FROM python:3.7
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
VOLUME /usr/src/app/
EXPOSE 8080
CMD [ “python”, “./server.py” ]

$ ls
→ bdd Dockerfile README.md requirements.txt server.py

My OS : Ubuntu 18.04

How to solve the problem ?

THX

instead of ${pwd} in your -v
try provinding the full path instead.

2 Likes

You have reason^^

I’ve done everything but this…

1 Like

so it worked?

${pwd} is always the directory that you are in, so if you “cd /tmp/”, and run the “docker run” command, docker will assume that the bdd directory is in: /tmp/bdd

Yes thx :slight_smile: