Skip to content

docker-compose: no declaration was found in the volumes section #67

Description

@Edke

Hello.

Trying to spin dvol, but encounter problems:

docker-compose.yml:

version: "2"
services:
  web:
    container_name: web-dev
    build:
      context: .
      dockerfile: services/development/web/Dockerfile
    links:
      - db
      - cache
    depends_on:
      - db
      - cache

  queue:
    container_name: queue-dev
    image: queue:latest
    entrypoint: python2.7 manage.py rqworker
    links:
      - db
      - cache
    depends_on:
      - db
      - cache

  db:
    container_name: db-dev
    image: db:latest
    volumes:
      - "db:/var/lib/postgresql/data"
    volume_driver: dvol

  cache:
    container_name: cache-dev
    image: redis:latest

spinning docker-compose:

$ docker-compose up
ERROR: Named volume "db:/var/lib/postgresql/data:rw" is used in service "db" but no declaration was found in the volumes section.
$ docker volume ls
list dvol: VolumeDriver.List: 
<html>
  <head><title>404 - No Such Resource</title></head>
  <body>
    <h1>No Such Resource</h1>
    <p>No such child resource.</p>
  </body>
</html>

DRIVER              VOLUME NAME
local               00894d48cfdd9d2493378e0b12413294756a20142cc8921b137881c5c6aecfc4
local               010b05964a81ad4219a9f3c05d55a24f9fefec4644a360498fb3ba064470290c
$ docker info
Containers: 32
 Running: 1
 Paused: 0
 Stopped: 31
Images: 195
Server Version: 1.12.1
Storage Driver: devicemapper
 Pool Name: docker-254:1-1054363-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 107.4 GB
 Backing Filesystem: ext4
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 17.87 GB
 Data Space Total: 107.4 GB
 Data Space Available: 4.271 GB
 Metadata Space Used: 20.53 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.127 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.133 (2016-08-15)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local dvol
 Network: bridge host null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.7.2-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 11.33 GiB
Name: thingol
ID: CFYC:6PZ7:X5EQ:U6CL:UVRT:NAYB:FART:Y3HS:Z4UE:UPRU:7EM6:XP25
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

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