I have "docker-compose" installed in my ubuntu 24.04 WSL linux, /usr/local/bin, as well as in windows

However, when VSCode launches, it says I don’t have docker-compose installed. The web says it’s not in my path, but I can go to a bash terminal that I launch vscode from, and low and behold, I can run it there. I can also run it from a windows command prompt. Why is this happening?

Steve

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Docker Compose Path Issues with VS Code and Torizon Extension

This is a common environment variable issue when VS Code can’t access the same PATH that your terminal session has. Here are the solutions:

For Windows with WSL2

  1. Launch VS Code from WSL2 terminal:

    • Open your WSL2 terminal (Ubuntu/Debian)
    • Navigate to your project directory
    • Run: code .
    • This ensures VS Code inherits the correct PATH from your WSL2 environment(1)
  2. Verify Docker context:

    • In VS Code, check that your Docker context is set to WSL2
    • The Torizon extension should detect your WSL2 Docker installation

For Linux Development Environment

  1. Check VS Code launch method:

    • Always launch VS Code from the terminal where docker-compose works
    • Run: which docker-compose to verify the path
    • Then launch: code . from the same terminal
  2. Environment variable inheritance:

    • VS Code needs to inherit the same environment variables as your terminal
    • Launching from the terminal ensures proper PATH inheritance

Torizon Extension Requirements

The Torizon VS Code Extension requires docker-compose for multi-container application development(2). The extension uses Docker Compose to define and run multi-container applications(3).

Verification Steps

  1. Test in terminal:

    docker-compose --version
    which docker-compose
    
  2. Launch VS Code correctly:

    cd /path/to/your/torizon/project
    code .
    
  3. Check VS Code terminal:

    • Open VS Code’s integrated terminal
    • Run docker-compose --version to verify it’s accessible

The key is ensuring VS Code inherits the same environment as your working terminal session where docker-compose is accessible(1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hey @EvetsMostel1,

Can you share the logs that produce the error?

The docker engine should be install within WSL. So the command line that you use to launch vscode (should be from windows) and the docker tool should be inside a WSL instance. So these shouldn’t be from the terminal.

-Eric

I launch VSC from the WSL terminal using “code .”. This is what MS recommends. The only way I get it to work is by running docker desktop on Windows. My VSC works fine at that point. I was hoping to make it work without docker desktop.

Steve

Hey @EvetsMostel1,

That isn’t the intended method. See the warning here: Set up the Torizon IDE Extension Environment | Toradex Developer Center

-Eric

@eric.tx

Yep, I’ve been with you guys since the early days. My VSC is installed via windows, but I launch it in Linux. That works fine. I already have ubuntu 24.04 installed in WSL and have been using it for a while. I know the extension has changed, and I have updated it for the most part. I haven’t downloaded the Torizon version of Linux though. I would think I could install a version of docker-compose that Torizon is satisfied with. Maybe I have to install the docker engine via commandline?

In the ai answer above, it says to use the “which” command which tells me that docker-compose is available in /usr/local/bin. I can also run “docker info” and that works. This is what is confusing. Why does it then say I don’t have it installed? It also says to launch VSC from the current directory using “code .”, which I do. Do you see anything wrong?

Steve

Hi @EvetsMostel1 ,
How did this proceed for you? Figure it out?
Have you considered also maybe doing a complete clean install of all the tools?

@eric.tx @michael.tx

The solution was to install docker in WSL ubuntu, but also to remove the existing docker container created by Docker Desktop, and then recreating the service/new container registry with this command:
docker run -d -p 5002:5002 --restart=always --name registry registry:2