-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
Alpine version of NGINX Unit does not exist: no PHP embed SAPI found #233
Comments
Also have the same problem |
EDIT 2 Sorry, now I see you use the official php image as the base image. But the php zts build includes SAPI: EDIT Now I see that you build it from source code, I don't know if you've tried it yet, but there is such an option: This is what I used when I first tried with the nginx unit, it's not perfect, but maybe it helps. I haven't dealt with it since then, maybe SAPI has been removed from it since then. FROM alpine:3.14
# Install packages and remove default server definition
RUN apk --no-cache add php7 php7-zip php7-intl php7-opcache php7-json php7-openssl php7-curl php7-tokenizer php7-exif php7-pcntl \
php7-zlib php7-xml php7-phar php7-dom php7-xmlreader php7-ctype php7-session php7-fileinfo php7-pdo_mysql \
php7-mbstring php7-gd php7-bcmath php7-gd php7-mcrypt php7-iconv unit unit-openrc unit-php7 curl \
git \
libpng-dev \
libxml2-dev \
zip \
unzip \
&& ln -sf /dev/stdout /var/log/unit.log \
&& ln -sf /dev/stdout /var/log/access.log
# Configure unit
COPY docker/nginx-unit/config.json /var/lib/unit/conf.json
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Make sure files/folders needed by the processes are accessable when they run under the unit user
RUN mkdir -p /.composer && \
mkdir -p /run/php && \
mkdir -p /var/www && \
chown -R unit:unit /var/www && \
chown -R unit:unit /.composer
# Set working directory
WORKDIR /var/www
# install all PHP dependencies
COPY --chown=unit src/composer.lock .
COPY --chown=unit src/composer.json .
RUN composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader
# Add application
COPY --chown=unit src/ .
COPY --chown=unit ./docker/.env ./.env
RUN composer dump-autoload
RUN php artisan optimize && php artisan config:cache && php artisan route:cache
EXPOSE 8080
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
# TODO: Implement HEALTHCHECK
# HEALTHCHECK --interval=5s --timeout=3s CMD curl --fail http://localhost/fpm-ping || exit 1 |
Affected Docker Images
Current Behavior
When attempting to build an Alpine version of Unit, the build fails with this error:
Reason why this is failing
PHP excluded
embed
for the Alpine versionsExpected Behavior
Unit should be able to compile and deliver an Alpine version.
Steps To Reproduce
Attempt to build an Alpine version locally:
👉 Next Steps & Proposed Solution
Notes on how development works
https://serversideup.net/open-source/docker-php/docs/getting-started/contributing
Add Embed support
embed
support (Enable embed also on alpine cli docker-library/php#1355 (comment))Example: 358f225
Update installer to support Debian and Alpine
docker-php/src/variations/unit/Dockerfile
Lines 21 to 60 in aa4ad44
Features to support
unitd
for "production use"unitd-debug
for debug useImportant notes on current functionality
https://github.com/serversideup/docker-php/blob/main/src/variations/unit/etc/entrypoint.d/10-init-unit.sh#L192
Validating functionality
The text was updated successfully, but these errors were encountered: