0

I want to run docker-compose.yaml file but i get the following error:

"invalid because: services.eventstore.volumes contains an invalid type, it should be an array".

I backup the eventstore file to my windows desktop and i want to restore it using docker.

Here is my docker-compose file:

version: '3'
services:
  eventstore:
    image: eventstore/eventstore:release-5.0.1
    container_name: eventstore
    ports:
      - 2113:2113
      - 1113:1113
    restart: always
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:2113/stats || exit 1"]
      interval: 5s
      timeout: 2s
    environment:
      - EVENTSTORE_RUN_PROJECTIONS=all
      - EVENTSTORE_START_STANDARD_PROJECTIONS=TRUE
    volumes:
      -C:/Users/cerdem/Desktop/eventstore:./data
      -C:/Users/cerdem/Desktop/eventstore:./logs

For more information, i got the errors after i put the volumes section, cuz i couldn't understand that part, and i will restore the db file from local not host.

My computer is running windows 1O.

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
Cemal
  • 153
  • 2
  • 8

2 Answers2

2

You need spaces after the dash in the volumes key.

    volumes:
      - C:/Users/cerdem/Desktop/eventstore:./data
      - C:/Users/cerdem/Desktop/eventstore:./logs

It is not recognized as array. Therefore, the type error.

"invalid because: services.eventstore.volumes contains an invalid type, it should be an array"

Here is the full version:

services:
  eventstore:
    image: eventstore/eventstore:release-5.0.1
    container_name: eventstore
    ports:
      - 2113:2113
      - 1113:1113
    restart: always
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:2113/stats || exit 1"]
      interval: 5s
      timeout: 2s
    environment:
      - EVENTSTORE_RUN_PROJECTIONS=all
      - EVENTSTORE_START_STANDARD_PROJECTIONS=TRUE
    volumes:
      - C:/Users/cerdem/Desktop/eventstore:./data
      - C:/Users/cerdem/Desktop/eventstore:./logs
The Fool
  • 16,715
  • 5
  • 52
  • 86
1

You have a few things going on:

  • You need a space after the dash.
  • You should wrap paths with 'strange' chars, like the . in quotes.
  • You need to format the windows paths in a way that Docker likes.

i.e.

    volumes:
      - '/c/Users/cerdem/Desktop/eventstore:./data'
      - '/c/Users/cerdem/Desktop/eventstore:./logs'

As an aside, I wrote a handy little script to make dealing with frequent Windows-2-Docker path conversions easier, if you're interested.

https://stackoverflow.com/a/54619756/553663

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94