Answer from @srfrnk works for me.
In my situation, I had the next docker-compose.yml file:
nginx:
build:
context: ./
dockerfile: "./docker/nginx.staging/Dockerfile"
depends_on:
- scripts
environment:
NGINX_SERVER_NAME: "some.host"
NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: scripts
NGINX_SERVER_ROOT: /var/www/html
volumes:
- ./docker-runtime/drupal/files:/var/www/html/sites/default/files:rw
ports:
- 80:80
./docker-runtime
owner and group - is root
when the other files owner - my user.
When I tried to build nginx
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
I added ./docker-runtime
to .dockerignore
and it is solved my problem.