Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: Cannot start service app: OCI runtime create failed:

After update my Mac to the Catalina, unfortunately, I got Error:

ERROR: for app Cannot start service app: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/maciejtrzcinski/Sites/docker/openinvest/config/apache/.htaccess\\\" to rootfs \\\"/mnt/sda1/var/lib/docker/overlay2/a088def6294f3c190633026f8d28b68bc6a6eb5cbca33f2dcf7272d716a54ba5/merged\\\" at \\\"/mnt/sda1/var/lib/docker/overlay2/a088def6294f3c190633026f8d28b68bc6a6eb5cbca33f2dcf7272d716a54ba5/merged/var/www/html/.htaccess\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

YML file:

version: "3"

services:
  app:
    image: wordpress:5.1.1-php7.2
    depends_on:
      - mariadb
    env_file:
      - .env
    volumes:
      - ./log/apache2:/var/log/apache2
      - ./config/apache/.apache:/var/www/html/.apache
      - ./wp-content:/var/www/html/wp-content
    ports:
      - 80:80
  mariadb:
    image: mariadb:10
    volumes:
      - ./data/mariadb:/var/lib
    ports:
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: ${WORDPRESS_DB_PASSWORD}
      MYSQL_DATABASE: ${WORDPRESS_DB_NAME}
      MYSQL_USER: ${WORDPRESS_DB_USER}
      MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD}

I'm trying with - ./config/apache/:/var/www/html/, but this also doesn't work. Anybody know maybe where is it the problem?

like image 273
Maciej Trzciński Avatar asked Oct 09 '19 06:10

Maciej Trzciński


1 Answers

I removed the old container and added a new one and works.

  1. docker-machine remove [old]
  2. docker-machine create [new]
  3. eval $(docker-machine env [new])
  4. docker-compose up
like image 109
Maciej Trzciński Avatar answered Sep 30 '22 09:09

Maciej Trzciński