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?
2
Answers
I removed the old container and added a new one and works.
docker-machine remove [old]
docker-machine create [new]
eval $(docker-machine env [new])
docker-compose up
I had a similar issue when I was working on a Rails application on Ubuntu 18.04. I have the application setup with a
Dockerfile
and withdocker-compose.yml
.Here’s the error I was getting:
I had previously built the image(s) using
docker-compose build
, so I no longer run thedocker-compose build
again, however, when I run the commanddocker-compose up
to start up the container(s), I get this error:The issue was that I moved and renamed the file
/entrypoints/rails-entrypoint.sh
todocker/entrypoints/docker-entrypoint.sh
.So when I run the command
docker-compose up
to start up the container(s) it fails because it can no longer find the/entrypoints/rails-entrypoint.sh
file.Here’s how I solved it:
Rebuild the image for the project by running the command. This copies the new file (
docker/entrypoints/docker-entrypoint.sh
) into the new image, and removes the link to the old file (/entrypoints/rails-entrypoint.sh
):And then start up the container again using the newly built image:
That’s all.
I hope this helps