version: "3"
services:
backend:
build:
context: .
args:
NODE_ENV: development
volumes:
- ./:/app:ro
- /app/node_modules
links:
- database
env_file:
- ./.env
command: npm run dev
database:
image: "postgres:latest"
volumes:
- pgdata:/var/lib/postgresql/data
expose:
- "5432"
ports:
- "5432:5432"
env_file:
- ./.env.database
pgadmin:
image: dpage/pgadmin4:latest
ports:
- 5454:5454/tcp
environment:
- PGADMIN_DEFAULT_EMAIL=<redacted>
- PGADMIN_DEFAULT_PASSWORD=<redacted>
- PGADMIN_LISTEN_PORT=5454
depends_on:
- database
volumes:
pgdata:
I would love to say "I found a few threads and tried what they recommend" but to be honest I don't really understand them when I read them yet. The following threads might be related but they read like Latin to me.
"Error response from daemon: failed to create shim: OCI runtime create failed" error on Windows machine
Cannot start service api: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "python manage.py runserver
Cannot start service app: OCI runtime create failed: container_linux.go:349
Like, my guess from reading the error message is that there's some sort of write permission I need to turn on, because the error message ends in "read-only file system: unknown". Sadly, that's all I can contribute.
–
In my case, docker compose had timed out, and had corrupted the containers. I just had to:
increase the compose timeout (COMPOSE_HTTP_TIMEOUT=480)
clean the containers (docker (image|container|network) prune
run compose again
Quite elementary good sir (Sherlock)...
Linux is just picky when it comes to executing files as an executable (redundant I know).
So you create a text file (or binary file) with commands but you want to then run that file and have it perform some job within the container, yet you will need to let the environment know that it has permissions to do so.
chown or chmod would do the trick.
--chmod-- approch
RUN chmod +x ./src/server.ts
The level of permissions (+x for all) gives the executable the rights to do so within the container.
In my case it was with docker compose and starting containers and I just recreated them.
docker-compose down
docker-compose up -d
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.