Prichmp
Prichmp

Reputation: 2292

docker-compose up "Cannot start service frontend: oci runtime error: not a directory"

I'm trying to launch a series of Docker Containers using Docker Compose. The problem is I keep getting an error message saying a directory is not valid. I have no idea what directory of mine dos not exist.

Here is my docker-compose.yaml (in the myProj folder):

version: '2'
services:
  postgres:
    build: ./postgres
    environment:
      - POSTGRES_PASSWORD=mysecretpassword
  frontend:
    build: ./frontend
    ports:
      - "4567:4567"
    depends_on:
      - postgres
  backend:
    build: ./backend
    ports:
       - "5000:5000"
    depends_on:
       - postgres

And a docker file for my backend container in (myProj/backend):

FROM openjdk:8-alpine
ADD ./backend-0.0.1-SNAPSHOT.jar /usr/src/myproj/
WORKDIR /usr/src/myproj/
CMD java -jar backend-0.0.1-SNAPSHOT.jar

When I run "docker-compose up" I get the following message:

docker_postgres_1 is up-to-date
Starting docker_backend_1
Starting docker_frontend_1

ERROR: for frontend  Cannot start service frontend: oci runtime error: not a directory

ERROR: for backend  Cannot start service backend: oci runtime error: not a directory
ERROR: Encountered errors while bringing up the project.

It seems the Postgres container builds fine. What directory do I need to fix?

Edit: Folder Structure

myProj
  - postgres
    - Dockerfile
  - frontend
    - Dockerfile
    - frontend-0.0.1-SNAPSHOT.jar
  - backend
    - Dockerfile
    - backend-0.0.1-SNAPSHOT.jar

Upvotes: 0

Views: 2592

Answers (2)

Prichmp
Prichmp

Reputation: 2292

I've (kind of) solved my own problem. I since decided to instantiate a CoreOS VM using Vagrant. Once I use CoreOS to run Docker-Compose everything started working as normal. Turns out the problem was not in my implementation, but It must be a bug with Docker-Compose, Docker-Machine, or Docker.

The versions that gave me problems are:

  • docker-compose version 1.8.0, build d988a55
  • docker-machine version 0.8.0, build b85aac1
  • docker version 1.12.0, build 8eab29e

While running on Windows 10 with VirtualBox.

Upvotes: 0

DevOps Dan
DevOps Dan

Reputation: 1853

Try restarting your Docker service first.

If that does not work, add this after the FROM statement in the Dockerfile:

RUN mkdir -p /usr/src/myproj/

Upvotes: 2

Related Questions