title: Docker-compose: volume name is too short, names should be at least two alphanumeric characters
body: <p>I would like to create an Apache container and mount current working directory as a volume in container, so I have this code:</p>
  <pre><code>volumes:
      - ${DOCUMENT_ROOT}:/var/www/html
  </code></pre>
  <p>The value of ${DOCUMENT_ROOT} is a dot in <code>.env</code> file:</p>
  <pre><code>DOCUMENT_ROOT=.
  </code></pre>
  <p>My <code>docker-compose.yml</code> file is at the root of my project directory and in my project directory there is a <code>.docker</code> directory.</p>
  <p>I tried this 3 lines:</p>
  <pre><code>volumes:
      - .:/var/www/html
  
  volumes:
      - ./:/var/www/html
  
  volumes:
      - ${DOCUMENT_ROOT}:/var/www/html
  </code></pre>
  <p>But I have this error:</p>
  <pre><code>Creating 7.4.x-webserver ... error ERROR: for 7.4.x-webserver  Cannot
  create container for service webserver: b'create .: volume name is too
  short, names should be at least two alphanumeric characters'
  
  ERROR: for webserver  Cannot create container for service webserver:
  b'create .: volume name is too short, names should be at least two
  alphanumeric characters' ERROR: Encountered errors while bringing up
  the project. Failed to deploy 'Compose: docker-compose.yml':
  `docker-compose` process finished with exit code 1
  </code></pre>
  <p>The content of my <code>docker-compose.yml</code> file:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: &quot;3&quot;
  
  services:
  webserver:
      build:
          context: ./.docker/bin/webserver
      container_name: '7.4.x-webserver'
      restart: 'always'
      ports:
          - &quot;${HOST_MACHINE_UNSECURE_HOST_PORT}:80&quot;
          - &quot;${HOST_MACHINE_SECURE_HOST_PORT}:443&quot;
      links:
          - mysql
      volumes:
          - ${DOCUMENT_ROOT}:/var/www/html
          - ${PHP_INI}:/usr/local/etc/php/php.ini
          - ${VHOSTS_DIR}:/etc/apache2/sites-enabled
          - ${LOG_DIR}:/var/log/apache2
  
  mysql:
      build:
          context: &quot;./.docker/bin/${DATABASE}&quot;
      container_name: 'mysql'
      restart: 'always'
      ports:
          - &quot;${HOST_MACHINE_MYSQL_PORT}:3306&quot;
      volumes:
          - ${MYSQL_DATA_DIR}:/var/lib/mysql
          - ${MYSQL_LOG_DIR}:/var/log/mysql
      environment:
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
          MYSQL_DATABASE: ${MYSQL_DATABASE}
          MYSQL_USER: ${MYSQL_USER}
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
  
  phpmyadmin:
      image: phpmyadmin/phpmyadmin
      container_name: 'sc-phpmyadmin'
      links:
          - mysql
      environment:
          PMA_HOST: mysql
          PMA_PORT: 3306
          PMA_USER: ${MYSQL_USER}
          PMA_PASSWORD: ${MYSQL_PASSWORD}
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
          MYSQL_USER: ${MYSQL_USER}
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      ports:
          - '${HOST_MACHINE_PHPMYADMIN_PORT}:80'
      volumes:
          - ./.docker/sessions
  
  redis:
      container_name: 'sc-redis'
      image: redis:latest
      ports:
          - &quot;${HOST_MACHINE_REDIS_PORT}:6379&quot;
  </code></pre>
  <p>.env:</p>
  <pre class="lang-sh prettyprint-override"><code>###&gt;  docker ###
  DOCUMENT_ROOT=.
  
  VHOSTS_DIR=./.docker/config/vhosts
  APACHE_LOG_DIR=./.docker/logs/apache2
  PHP_INI=./.docker/config/php/php.ini
  
  DATABASE=mysql8
  
  MYSQL_DATA_DIR=./.docker/data/mysql
  MYSQL_LOG_DIR=./.docker/logs/mysql
  
  HOST_MACHINE_UNSECURE_HOST_PORT=80
  HOST_MACHINE_SECURE_HOST_PORT=443
  HOST_MACHINE_MYSQL_PORT=3306
  HOST_MACHINE_PHPMYADMIN_PORT=8080
  HOST_MACHINE_REDIS_PORT=6379
  
  MYSQL_ROOT_PASSWORD=tiger
  MYSQL_USER=docker
  MYSQL_PASSWORD=docker
  MYSQL_DATABASE=docker
  ###&gt;  docker ###
  </code></pre>
  <p>How to fix this error please ?</p>
  <p>In advance, thank you for your help</p>