xdebugを素のalpine+phpで入れる最小構成。
FROM alpine:latest
RUN apk update \
&& apk add php7
# for Xdebug
RUN apk add php7-xdebug
# イメージによっては RUN apk add php7-pecl-xdebug
COPY xdebug.ini /etc/php7/conf.d/xdebug.ini
xdebug.ini
zend_extension=/usr/lib/php7/modules/xdebug.so
[XDebug]
xdebug.remote_autostart=1
xdebug.remote_enable=1
# 自分のpcのIP address
xdebug.remote_host=192.168.254.163
xdebug.remote_port=9001
xdebug.remote_log=/tmp/xdebug.log
xdebug.remote_mode=req
xdebug.idekey=xdebug
xdebug.remote_handler=dbgp