Closed intellent closed 3 years ago
You should use IP
instead of host.docker.internal
.
You should use
IP
instead ofhost.docker.internal
.
Oh, okay. Afaik the internal IP of the Docker host is not static.
Thanks for your feedback, I will support the domain name in the next version.
Hi, we can use debug init file to set the remote_host
. #98 #97
@huanghantao @intellent which ip should I use inside a docker? host.docker.internal, 127.0.0.1, 0.0.0.0 not working for me
host.docker.internal shows me error - [yasd] recv command error, connection closed but 127.0.0.1, 0.0.0.0 - [yasd] Connect IDE failed (Connection refused), please check that the IDE is in a listening state
could you help me please?
FROM hyperf/hyperf:8.0-alpine-v3.15-swoole
RUN set -ex \
&& apk add $PHPIZE_DEPS \
openssl-dev \
boost-dev \
&& ln -sf /usr/bin/phpize8 /usr/local/bin/phpize \
&& ln -sf /usr/bin/php-config8 /usr/local/bin/php-config
RUN git clone https://github.com/swoole/yasd.git \
&& cd yasd \
&& phpize --clean \
&& phpize \
&& ./configure \
&& make clean \
&& make \
&& make install
RUN echo "extension=yasd.so" > /etc/php8/conf.d/50_yasd.ini \
&& echo "yasd.debug_mode=remote" >> /etc/php8/conf.d/50_yasd.ini \
&& echo "yasd.remote_host=host.docker.internal" >> /etc/php8/conf.d/50_yasd.ini \
&& echo "yasd.remote_port=9000" >> /etc/php8/conf.d/50_yasd.ini
WORKDIR /data/project
COPY entrypoint.sh /scripts/entrypoint.sh
RUN chmod +x /scripts/entrypoint.sh
ENTRYPOINT ["/scripts/entrypoint.sh"]
Hyperf 2.2 scan_cacheable=true
I am trying to get yasd running on PHP 8 inside Docker with VS Code in my Docker host.
My
Dockerfile
:My
yasd.ini
:My
launch.json
for VS Code:When running my container, I instantly get the error:
If I remove the
-e
argument from the PHP call, my service starts and works fine. However, debugging from VS Code does not work (breakpoints not detected).Any hints what else I can try?