Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Volume edited by systemd-coredump docker

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:

enter image description here

Why the permissions to the volume /db are set to another user... ?

Regards

like image 879
FindL Avatar asked Apr 26 '20 19:04

FindL


People also ask

What is Systemd Coredump user?

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.

Does Docker compose down Remove named volumes?

Networks and volumes defined as external are never removed. Anonymous volumes are not removed by default.

Does Docker compose create volumes?

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.


1 Answers

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.

like image 105
fireside68 Avatar answered Nov 15 '22 04:11

fireside68