Totally newby in docker - "Invalid interpolation format" problem with docker-compose up command

Please can you help me with this problem?

  • I am totally new in docker, without any experience …

  • I am learning spring boot just now (I have basic experience) - one of the first parts of this spring boot tutorial deals with setting configuration file (docker-compose.yml) for docker

  • I have Win7 OS, so i had to install DockerToolbox-19.03.1 - this seems to work fine - the same responses are straight from its terminal and from Intellij IDEA terminal

  • when I try to run compse command, I always get this error message:

    PS D:\work\java\microservices2> docker-compose up -d
    
    ERROR: Invalid interpolation format for "pgadmin" option in service "services": "${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}"
    
  • and this is a content of docker-compose.yml:

    services:
      postgres:
        container_name: postgres
        image: postgres
        environment:
          POSTGRES_USER: admin
          POSTGRES_PASSWORD: password
          PGDATA: /data/postgres
        volumes:
          - postgres:/data/postgres
        ports:
          - "5432:5432"
        networks:
          - postgres
        restart: unless-stopped
    
      pgadmin:
        container_name: pgadmin
        image: dpage/pgadmin4
        environment:
    
          PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
          PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
          PGADMIN_CONFIG_SERVER_MODE: 'False'
    
        volumes:
          - pgadmin:/var/lib/pgadmin
        ports:
          - "5050:80"
        networks:
          - postgres
        restart: unless-stopped
    
      networks:
        postgres:
          driver: bridge
    
      volumes:
        postgres:
        pgadmin:
    

I assume you are aware that toolbox is deprecated. If it’s an option for you, you could use vagrant to replace the toolbox and run the latest docker engine in VirtualBox Debian/Ubuntu VM.

Make sure to set the version of the compose schema, if i am not mistaken it will be treated as 1.0 otherwise. You need at least docker-compose v1.9.0 and a schema version of 2.1 or higher to use the interpolation with default values (see Docker Compose release notes vor v1.9.0)

Please try to set a version (personaly I would choose 2.4 for non swarm deployements) and see if the interpolation works as expected. If it doesn’t, try if escaping the @-character with a $-character helps.

1 Like

Thank you very much for your response - I will try it.