Skip to content

docker-sync -n should create dummy volumes for non-started syncs #807

@jlurena

Description

@jlurena

Error/Feature Requestion/Docs

Context:

  • I have a monorepo
  • I have several syncs docker-sync.yml.
  • I have several services in docker-compose.yml
# docker-sync.yml
version: "2"
options:
  project_root: 'config_path'
syncs:
  api-docker-sync
    src: './api'
  web_app-docker-sync
    src: './webapp'
  web_app_v2-docker-sync
    src: './webapp_v2'
# docker-compose.yml
version: "3.9"
services:
  api:
    container_name: api
    build:
      context: .
      dockerfile: api/Dockerfile
    volumes:
      - api-docker-sync:/home/app/api
    ports:
      - 8000:8080

  web_app:
    container_name: web_app
    build:
      context: .
      dockerfile: web_app/Dockerfile
    volumes:
      - web_app-docker-sync:/home/app/web_app:nocopy
    ports:
      - 8080:8080

  web_app_v2:
    container_name: another_web_app
    build:
      context: .
      dockerfile: web_app/Dockerfile
    volumes:
      - web_app-docker-sync:/home/app/web_app_v2:nocopy
    ports:
      - 8080:8080
volumes:
  api-docker-sync-docker-sync:
    external: true
  web_app-docker-sync:
    external: true
  web_app_v2-docker-sync:
    external: true

Expectation

  1. I should be able to start sync on only apps that I am working on
    • docker-sync start -n api-docker-sync-docker-sync && docker-sync start -n web_app_v2-docker-sync
    • docker-compose up api web_app_v2

Instead, I get the following error:
external volume "web_app-docker-sync" not found

Potential Solution

  1. docker-sync should create empty volumes for non-started syncs.

I'd love to help with this. Will take me some time to ramp up and understand this though. If anyone can point me in right direction or help with this, that'd be great.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions