title: docker-compose error when creating MySQL database container
body: <p>I have the following <code>docker-compose.yml</code> and <code>Dockerfile</code> in my Spring Boot app but when I run <code>docker-compose up -d</code>, I get the following error:</p>
  <blockquote>
  <p>&quot;failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount967315702/Dockerfile: no such file or directory&quot;</p>
  </blockquote>
  <p>As I use <strong>Windows10</strong>, I think I need some tweaks related to the WORKDIR, etc. I have WSL where Docker installed). But even I tried different combinations, I have not managed to fix the problem.</p>
  <p>Here is the <code>docker-compose.yml</code> and <code>Dockerfile</code> in my root project folder (<code>springboot-backend</code>):</p>
  <p><em><strong>docker-compose.yml:</strong></em> I am not sure about</p>
  <pre><code>version: &quot;3.8&quot;
  services:
    mysqldb:
      image: mysql:5.7
      restart: unless-stopped
      env_file: ./.env
      environment:
        - MYSQL_ROOT_PASSWORD=$MYSQLDB_ROOT_PASSWORD
        - MYSQL_DATABASE=$MYSQLDB_DATABASE
      ports:
        - $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT
      volumes:
        - db:/var/lib/mysql
    app:
      depends_on:
        - mysqldb
      build: ./springboot-backend
      restart: on-failure
      env_file: ./.env
      ports:
        - $SPRING_LOCAL_PORT:$SPRING_DOCKER_PORT
      environment:
        SPRING_APPLICATION_JSON: '{
          &quot;spring.datasource.url&quot;  : &quot;jdbc:mysql://mysqldb:$MYSQLDB_DOCKER_PORT/$MYSQLDB_DATABASE?useSSL=false&quot;,
          &quot;spring.datasource.username&quot; : &quot;$MYSQLDB_USER&quot;,
          &quot;spring.datasource.password&quot; : &quot;$MYSQLDB_ROOT_PASSWORD&quot;,
          &quot;spring.jpa.properties.hibernate.dialect&quot; : &quot;org.hibernate.dialect.MySQL5InnoDBDialect&quot;,
          &quot;spring.jpa.hibernate.ddl-auto&quot; : &quot;update&quot;
        }'
      volumes:
        - .m2:/root/.m2
      stdin_open: true
      tty: true
  volumes:
    db:
  </code></pre>
  <p><em><strong>Dockerfile:</strong></em></p>
  <pre><code>FROM maven:3.8.2-jdk-8
  WORKDIR /springboot-backend
  COPY . .
  RUN mvn clean install
  CMD mvn spring-boot:run
  </code></pre>
  <p><em><strong>.env file:</strong></em></p>
  <pre><code>MYSQLDB_USER=root
  MYSQLDB_ROOT_PASSWORD=******
  MYSQLDB_DATABASE=employee_management_system
  MYSQLDB_LOCAL_PORT=3307
  MYSQLDB_DOCKER_PORT=3306
  SPRING_LOCAL_PORT=6868
  SPRING_DOCKER_PORT=8080
  </code></pre>
  <p>Any idea?</p>
  <p>Here is folder structure:</p>
  <p><a href="https://i.stack.imgur.com/eLnRd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eLnRd.png" alt="enter image description here" /></a></p>