Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate xdebug support on Linux #169

Merged
merged 2 commits into from
Sep 6, 2023
Merged

Automate xdebug support on Linux #169

merged 2 commits into from
Sep 6, 2023

Conversation

defunctl
Copy link
Contributor

@defunctl defunctl commented Sep 5, 2023

⚠️ Please test this on a Mac! - This shouldn't break anything, but make sure you can use xdebug properly as before after restarting slic as I don't have a Mac to test with.

This automates xdebug support on Linux, putting the correct IP in the container's hosts file with the host.docker.internal name just like on a Mac/Windows.

Confirm my Docker gateway IP:

$ ip route | grep docker0 | awk '{print $9}'
172.17.0.1
slic shell

172.17.0.1 host.docker.internal is now added to /etc/hosts:

[slic@slic] /var/www/html/wp-content/plugins/whatever
 > cat /etc/hosts
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.17.0.1	host.docker.internal
172.28.0.6	970efb9ed2ce

Ref: docker/for-linux#264 (comment)

@defunctl defunctl added this to the 1.4.5 milestone Sep 5, 2023
@defunctl defunctl self-assigned this Sep 5, 2023
Copy link
Contributor

@lucatume lucatume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Mac, no issues.

@lucatume lucatume changed the base branch from main to 1.5.0 September 6, 2023 08:19
@lucatume lucatume merged commit 4dd7eef into 1.5.0 Sep 6, 2023
@lucatume lucatume deleted the feature/linux-xdebug branch September 6, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants