Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

997
Views
WSL2 docker-compose - unable to prepare context

I am using the Docker Engine running on WSL2 which is running on Windows 10 computer. My goal is to create a service using the Docker-compose that uses the php:fpm image and install the mysqli extension to it. Here is my docker-compose.yaml

version: "3"

services:
  nginx:
    image: "nginx"
    restart: 'always'
    ports:
      - '3030:80'
    volumes:
      - ./src:/src
      - ./config/site.conf:/etc/nginx/conf.d/default.conf
    networks:
        - code-network
  php:
    build:
      context: .
      dockerfile: Dockerfile
    image: php:fpm
    volumes:
        - ./src:/src
    networks:
        - code-network
  mariadb:
    image: "mariadb:10.3.24"
    restart: 'always'
    volumes:
      - "/var/lib/mysql/data:/data"
      - "/var/lib/mysql/logs:/logs"
      - /var/docker/mariadb/conf:/etc/mysql
    environment:
      MYSQL_ROOT_PASSWORD: "root"
      MYSQL_DATABASE: "T05CNCitk2020@"
      MYSQL_USER: "user"
      MYSQL_PASSWORD: "Heslo123"
    networks:
        - code-network

networks:
    code-network:
        driver: bridge

And here is my Dockerfile:

FROM php:fpm

RUN docker-php-ext-install mysqli

When I run the command docker-compose up --build which forces the container to rebuild. I ran into the following problem:

Building php
unable to prepare context: path "\\\\?\\\\\\wsl$\\Ubuntu-20.04\\home\\vendasky\\Projects\\sql-gui" not found
ERROR: Service 'php' failed to build : Build failed

I do not see the reason why the path should be wrong when all the files are located in the Linux subsystem. Any hints, how to solve this problem?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

are you runnning this with docker desktop for windows?

If thats the case try enabling the Docker Compose V2 option under the experimental settings. This should fix your problem.

over 4 years ago · Santiago Trujillo Report

0

Docker is unable to find the path to that project, map your ubuntu correctly so it can easily locate the project, that should fix your issue.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!