Skip to content

Cannot update nginx config: device or resource busy #317

Closed
@tntrex

Description

@tntrex

Hi

I use jwilder/docker-gen docker image alongside with nginx docker image for proxying containers with other web services on my local development environment (Docker for Windows). This combination worked great for a long time. But after recent Docker for Windows update (current stable version 2.2.0.0) I start getting errors in jwilder/docker-gen container:

Unable to create dest file /etc/nginx/conf.d/default.conf: rename /etc/nginx/conf.d/docker-gen728953019 /etc/nginx/conf.d/default.conf: device or resource busy

I tried to boot into container tty instead of running docker-gen script and move file manually and it works without errors.

My docker-compose config:

version: '3'

services:
  nginx:
    image: nginx:1.17
    container_name: ld-proxy-nginx
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./volumes/conf.d:/etc/nginx/conf.d:ro
      - ./volumes/vhost.d:/etc/nginx/vhost.d:ro
      - ./volumes/certs:/etc/nginx/certs:ro
    networks:
      - localhost

  docker-gen:
    image: jwilder/docker-gen:0.7.3
    container_name: ld-proxy-gen
    restart: always
    depends_on:
      - nginx
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./templates:/etc/docker-gen/templates:ro
      - ./volumes/conf.d:/etc/nginx/conf.d:rw
      - ./volumes/vhost.d:/etc/nginx/vhost.d:ro
      - ./volumes/certs:/etc/nginx/certs:ro
    networks:
      - localhost
    entrypoint: /usr/local/bin/docker-gen -notify-sighup ld-proxy-nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf

networks:
  localhost:
    external: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions