N
N
nathan1117772021-10-10 22:47:33
linux
nathan111777, 2021-10-10 22:47:33

Why did docker containers stop running after changing the permissions for the var, www, html folders?

I have Ubuntu 18.04 OS. I want to raise my Drupal project using Docker, namely Docker4Drupal - which contains the necessary images for locally lifting a Drupal site.

After writing the command , I have php, mariadb, ngnix, phpmyadmin, mailhog, crond, adminer, traefik, nodedocker-compose up -d images/containers running . But when I wrote the command , I saw that the node container (node.js image) is not in the list of running / running. Having registered the command, I found out that the reason is that there are not enough rights to the folder:docker psdocker-compose logs node

error Could not write file "var/www/html/nodebuild/yarn-error.log": EACESS: permission denied, open 'var/www/html/path/to/theme/to build/yarn-error.log' "

First, I gave the rights:
sudo chmod -R 666 /var
sudo chmod -R 666 /var/www
sudo chmod -R 666 /var/www/html
sudo chmod -R 666 /var/www/html/nodebuild

But putting the first 6 ku was a mistake, because even I could not go to the /var or /var/www
folder. Therefore, I returned the rights to myself and even gave more rights to others:
sudo chmod 777 /var/ -R
sudo chmod 777 /var/www/ -R
sudo chmod 777 /var/www/html -R
sudo chmod 777 /var/www/html/nodebuild -R


When I ran the command again docker-compose up -dand docker psI saw that now there are only three containers in the list of running / running (phpmyadmin, traefik, mailhog).

I looked at the rights and who is the owner of the folders I work with:
Папка | Права | Права в цифровом формате | Владелец | Группа 
var | drwxr-xr-x | 755 | root | root 
www  | drwxrwxrwx | 777 | root | root
html | drwxrwsrwx | 777 | andriy | andriy
bc_news | drwxrwxr-x | 775 | andriy | andriy

My bc_news folder is the folder where the Drupal project and docker4drupal files (docker-compose.yml, .env, traefik.yml, Makefile) are located - that is, docker4drupal itself .
In addition, I saw (if I looked correctly) that Docker is running under the root user.

What is the reason that so many containers are not running? And how to fix it?

I will also add what the docker-compose logs node command displays
61633da3c9bc5687333057.png

And what does the docker-compose logs php command display
61633dcf1b7de900107875.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2021-10-11
@CityCat4

Congratulations bro!
Prize on the topic "How to ruin the system with one command and it should not be rm -rf /" - to the studio!
Now you will have to rearrange if there is no operating system at hand, from which you could carefully manually transfer the rights to the folders.
But it will stick in memory for a long time - that you should not do some things. You were asked for permissions on a separate file, and you broke the permissions on the entire /var - the place where the rights are most spread out.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question