VSCode into Remote Docker Host Container XDebug

Written by James McDonald

September 30, 2021

I have another post that is VSCode on Windows 10 SSH into remote host and working in the project source directory then Xdebug

This post is different as it connecting to the Remote Docker Container and working inside the container.

VSCode running on Windows 10

Remote Docker host is running Ubuntu 20.04 and a number of containers running on docker

Windows 10 has Docker Desktop installed

launch.json contains

In VSCode Remote Explorer under Containers has a list of containers running on my remote Ubuntu box (see settings.json)

settings.json tells vscode about your remote Docker Host

Inside the container I have xdebug 3 compiled and the conf files with contents of both these the same

/etc/php/7.4/apache2/conf.d/25-xdebug.ini

and

/etc/php/7.4/cli/conf.d/25-xdebug.ini inside container

[xdebug]
xdebug.mode = debug
xdebug.remote_enable = 1
; xdebug.remote_connect_back = 1
; xdebug.remote_host = 172.17.0.1
; this 
; xdebug.client_host=172.17.0.1
xdebug.idekey = "VSCODE"
xdebug.client_port = 9000
xdebug.remote_autostart = 1
xdebug.start_with_request = yes
xdebug.log=/tmp/xdebug-local.log

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…