Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!