I'm using Windows 11 and PhpStorm (2023.3.2). PhpStorm connects to a WSL2 Ubuntu (22.04 jammy). This Ubuntu has Docker engine installed, it is used for builds and composing dev servers.
PhpStorm is connected to the docker service using WSL2 connection, as :
This configuration works fine and allows me to build and compose with PhpStorm from Windows host. But when I composer up
a container, it is always considered as an orphan container in PhpStorm.
The first thing I tried was to check already existing topics about this issue, but I found none. I tried keywords like :
- docker phpstorm orphans WSL
- docker phpstorm orphan containers
- docker phpstorm ubuntu WSL
So, I started by simplifying my current docker-compose.yml
file using a simple image and configuration.
Here are my simplest possible try, which I will base my next tests :
services:
pgAdmin:
image: dpage/pgadmin4
ports:
- 5431:80
environment:
PGADMIN_DEFAULT_EMAIL: ${PG_USERNAME-AAA}
PGADMIN_DEFAULT_PASSWORD: ${PG_PASSWORD-BBB}
So the problem doesn't seems to be related to the content of the docker-compose.yml
but rather my PhpStorm configuration. My PhpStorm deployment configuration is default, but here it is, just in case :
I tried to docker compose up -d
from shell
, the result is the same : orphan container in PhpStorm :
Listing my docker containers from the shell didn't triggered any warning about orphan elements :
Could all of this be related to a docker PhpStorm module bug ? Since I didn't get any error from the console commands.
A quick scheme of my environment and a resume :
PhpStorm connects from Windows 11 to WSL2 Ubuntu, this Ubuntu has docker installed. PhpStorm connect itself to the remote WSL2 docker. Everything works (building, env files, compose with options), the only issue is that all container are considered as orphans in PhpStorm.