Docker compose won't find $PWD environment variable

后端 未结 5 2290
星月不相逢
星月不相逢 2020-12-14 06:44

Here\'s my docker-compose:

version: \'2\'
services:
  couchpotato:
    build:
        context: ./couchpotato
        dockerfile: Dockerfile
    ports:
     -         


        
5条回答
  •  难免孤独
    2020-12-14 07:19

    I was with the same issues, on Windows.

    For solve "mariadb keeping restarting", I was using this:

    mariadb:
      image: mariadb
      volumes:
        - ${PWD}/data:/var/lib/mysql
    

    It solved, but always showed me the message:

    WARNING: The PWD variable is not set. Defaulting to a blank string.
    

    Then I just used on this way, whithout "." at beginning:

    mariadb:
      image: mariadb
      volumes:
        - /data:/var/lib/mysql
    

提交回复
热议问题