I'm trying to make a Symfony project running in docker container. So, there is my docker-compose.yml :
version: '3.7'
services:
mariadb:
image: ${MARIADB_VERSION}
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- ${PORTS_MARIADB}
volumes:
- './db/:/var/lib/mysql'
php:
build:
context: .
dockerfile: docker/php/Dockerfile
volumes:
- './app/:/usr/src/app'
restart: on-failure
user: 1000:1000
nginx:
image: ${NGINX_VERSION}
restart: on-failure
volumes:
- './app/public/:/usr/src/app'
- './docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro'
ports:
- ${PORTS_NGINX}
depends_on:
- php
I start my container like this (with non-root user):
docker-compose build
docker-compose up -d
So, at this point, all is ok but, If I want to re-build my docker container:
docker-compose down
docker-compose build
The volume ./db (of mariadb) have his permissions set to systemd-coredump:findl users (findl is mine) So, I have this error when I try to build the container:
Why the permissions to the volume /db are set to another user... ?
Regards
systemd-coredump@. service is a system service to process core dumps. It will log a summary of the event to systemd-journald. service(8), including information about the process identifier, owner, the signal that killed the process, and the stack trace if possible. It may also save the core dump for later processing.
Networks and volumes defined as external are never removed. Anonymous volumes are not removed by default.
We can also create a volume with Docker compose service or also specify existing volumes. For example, the following screenshot shows a 'docker-compose' file that creates a docker-compose service with a volume. As a result of the above command, a volume with the name 'myvolume' gets created.
As a result of this Github issue reply, I was able to fix my issues and move on. Basically, take the temporary portion of your volume and add it to .dockerignore
. The commenter does a much better explanation of why it works than I would ever be able to muster here, but if this gets you (or anyone else who runs into this issue) farther along, then so be it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With