Comments (6)
Final solution has been to update PR #35 to adhere to the following:
-
Introduces a new command
warden debug
; when this is run the user is launched into a shell similarly to whenwarden shell
is run, but in this case the shell is opened by default within the php-debug container. -
When user is launched into a debug container, the env variable XDEBUG_REMOTE_HOST is passed in and conditionally set to either
host.docker.internal
on macOS and to the gateway IP of the warden network on Linux systems. -
The base images have been updated to add the following to
/etc/php-cli.ini
bringing it all together without any potential for disrupting already present and reliable in-browser debugging:
[php]
xdebug.remote_autostart=on
xdebug.remote_host=${XDEBUG_REMOTE_HOST}
Big shout out to @wcrb15 for helping ascertain what the remote host should be configured to on Linux systems and to @molotovbliss for getting the ball rolling with the idea of a special debug command.
from warden.
@davidalger this sounds as a great idea.
I'm not sure if I'm missing something, but wouldn't it be just about adding those two config directives in /etc/php.d/15-xdebug.ini in this container?
from warden.
Per a conversation I had with @wcrb15 the gateway IP of the warden
network works as the remote_host on Linux systems. So in order to resolve this, it should be possible to look up and pass this gateway IP address as an extra_hosts parameter on Linux systems allowing docker.host.internal to resolve there as well as on macOS within the php-debug container. For the sake of not disrupting any existing functionality, the use of connect back for browser requests should remain untouched.
The gateway IP address can be looked up via the following similar to [what is done here](docker container inspect traefik --format '{{.NetworkSettings.Networks.warden.Gateway}}'):
docker container inspect traefik --format '{{.NetworkSettings.Networks.warden.Gateway}}'
from warden.
Big shout out to @wcrb15 for helping ascertain what the remote host should be configured to on Linux systems and to @molotovbliss for getting the ball rolling with the idea of a special debug command.
Thanks for the 😊 props, and same to @chapagain for updating my old gist with this feature! Cheers. 🍻
from warden.
10/18/19, 10:10 AM
I pass the values to the container environment variables via docker compose and -e.
e.g. docker-compose run -e PHP_IDE_CONFIG="serverName=$server_name" -e XDEBUG_CONFIG="remote_host=172.17.0.1" magento-cli "$@" now i just use this command instead of running with php flags
ref: https://twitter.com/petey_tweety/status/1185211571493994496
from warden.
https://gist.github.com/molotovbliss/3eb18a2b0366d9b9e15647322641816d just to note for a possible way to get the container id along with passing the usual xdebug php params & script file to debug.
Created a PR with included help file and removal and clean-up. Version change may not be needed, FYI.
from warden.
Related Issues (20)
- ERROR: invalid reference format on warden env up HOT 1
- [Image] invalid tag format for MARIADB_VERSION=10.6 HOT 8
- Migrate all `docker-compose` commands to `docker compose` commands HOT 6
- Automate release process
- [Image] magento 2 error pull maria db HOT 6
- [Command] warden env up HOT 3
- Mutagen syncing is taking ages HOT 2
- tunnel panubo/sshd:latest HOT 1
- Too many networks HOT 1
- DB_DISTRIBUTION and DB_DISTRIBUTION_VERSION are not working? HOT 5
- tunnel reports chmod operation not permitted HOT 6
- Present a warning during `warden env up` if `warden svc up` / `warden install` needs to be re-ran due to an operating system upgrade HOT 1
- Add in-depth ZSH Autocompletion
- [Image] php containers exiting with code (2) HOT 8
- Unable to run integration tests HOT 3
- [Image] Docker not found after sys reboot HOT 2
- [Brew] On linux Warden files for SSL certs created under root user when installed via brew
- warden svc up for first time issue in Linux 20.04
- db containter not working HOT 8
- Feature: Ability to Pipe into `warden shell` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warden.