Giter Club home page Giter Club logo

Comments (4)

leocavalcante avatar leocavalcante commented on May 26, 2024 2

If someone else gets here, I got this working by replacing the remote_host at the ENTRYPOINT:

docker-entrypoint.sh
#!/usr/bin/env sh
echo "yasd.remote_host=$(getent hosts host.docker.internal | awk '{print $1}')" >> "$PHP_INI_DIR/conf.d/99_overrides.ini"
php "$@"
Dockerfile
FROM phpswoole/swoole:4.6-php7.4-alpine
RUN apk add boost-dev

RUN wget -c https://github.com/swoole/yasd/archive/refs/tags/v0.3.7.tar.gz -O - | tar -xz \
    && docker-php-source extract \
    && mv yasd-0.3.7 /usr/src/php/ext/yasd \
    && docker-php-ext-install yasd

RUN { \
    echo "yasd.debug_mode=remote"; \
    echo "yasd.remote_host=0.0.0.0"; \
    echo "yasd.remote_port=9000"; \
} | tee "$PHP_INI_DIR/conf.d/99_overrides.ini"

ADD docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "sh", "-c", "/docker-entrypoint.sh" ]
docker-compose.yml
version: '3.8'
services:
  dev:
    container_name: coroutine_context_api
    tty: true
    build: .
    volumes:
      - ./:/var/www
    environment:
      - PHP_IDE_CONFIG=serverName=CoroutineContextAPI

The PHP_IDE_CONFIG is important to have your paths mapped.

from yasd.

zyimm avatar zyimm commented on May 26, 2024

自己琢磨一下:
Invalid address/ Address not supported: No error information 这个错误
可以使用 init_file 添加 setRemoteHost 解决。
然而 swoole 没有启动,也没有任何报错。

/www/2021/mermber-center # php -e bin/hyperf.php start
[yasd] execute init_file success


希望作者完善文档吧,目前在docker下确实不知道怎么使用?

from yasd.

huanghantao avatar huanghantao commented on May 26, 2024

加我微信: codinghuang

from yasd.

zyimm avatar zyimm commented on May 26, 2024

If someone else gets here, I got this working by replacing the remote_host at the ENTRYPOINT:

docker-entrypoint.sh
#!/usr/bin/env sh
echo "yasd.remote_host=$(getent hosts host.docker.internal | awk '{print $1}')" >> "$PHP_INI_DIR/conf.d/99_overrides.ini"
php "$@"
Dockerfile
FROM phpswoole/swoole:4.6-php7.4-alpine
RUN apk add boost-dev

RUN wget -c https://github.com/swoole/yasd/archive/refs/tags/v0.3.7.tar.gz -O - | tar -xz \
    && docker-php-source extract \
    && mv yasd-0.3.7 /usr/src/php/ext/yasd \
    && docker-php-ext-install yasd

RUN { \
    echo "yasd.debug_mode=remote"; \
    echo "yasd.remote_host=0.0.0.0"; \
    echo "yasd.remote_port=9000"; \
} | tee "$PHP_INI_DIR/conf.d/99_overrides.ini"

ADD docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "sh", "-c", "/docker-entrypoint.sh" ]
docker-compose.yml
version: '3.8'
services:
  dev:
    container_name: coroutine_context_api
    tty: true
    build: .
    volumes:
      - ./:/var/www
    environment:
      - PHP_IDE_CONFIG=serverName=CoroutineContextAPI

The PHP_IDE_CONFIG is important to have your paths mapped.

Yes, thank you! It's working

from yasd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.