Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

82
Vistas
docker-stack.yml invalid volume type bind

This is my docker-stack.yml file

    version: "3"

    services:
      mysql:
        image: mysql:latest
        deploy:
          replicas: 1
          update_config:
            parallelism: 1
          restart_policy:
            condition: on-failure
        ports:
          - "3306:3306"
        environment:
          MYSQL_ROOT_PASSWORD: <Censored>
          MYSQL_USER: <Censored>
          MYSQL_PASSWORD: <Censored>
        volumes:
          - ./db/data:/var/lib/mysql
          - ./db/logs:/var/log/mysql
          - ./db/config:/etc/mysql/conf.d
      php:
        image: wiput1999/php
        volumes:
          - ./web:/web
      nginx:
        image: nginx:latest
        ports:
          - "80:80"
          - "443:443"
        volumes:
          - ./code:/code:ro
          - ./site.conf:/etc/nginx/conf.d/default.conf
          - /etc/letsencrypt:/etc/letsencrypt
          - ./nginx/log:/var/log/nginx

When I run this following stack I got mysql and nginx with this error "invalid mount config for type "bind": bind source path does not exist"

I have no idea what wrong with my code.

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

bind is a type of mount that is used to mount a directory (or a file) on the host into the container. All of your volumes are set up like that. So one of your source directories (or files) do not exists on the host. Check each of these:

  • ./db/data
  • ./db/logs
  • ./db/config
  • ./web
  • ./code
  • ./site.conf
  • /etc/letsencrypt
  • ./nginx/log

You could execute ls -ld ./db/data ./db/logs ./db/config ./web ./code ./site.conf /etc/letsencrypt ./nginx/log >/dev/null and look at the error message to find out which one.

about 4 years ago · Santiago Trujillo Denunciar

0

Please consider to use docker configs and docker secrets in place of volumes.

version: "3.3"

services:
  nginx:
    configs:
      - source: nginx_vhost
        target: /etc/nginx/conf.d/default.conf
    secrets:
      - ssl_private_key
...

configs:
  nginx_vhost:
    file: ./site.conf

secrets:
  ssl_private_key:
    file: /etc/letsencrypt/private.key

https://docs.docker.com/engine/swarm/configs/ and https://docs.docker.com/compose/compose-file/#configs

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda