|
| 1 | +FROM clearlinux:latest AS builder |
| 2 | + |
| 3 | + |
| 4 | +ARG swupd_args |
| 5 | +# Move to latest Clear Linux release to ensure |
| 6 | +# that the swupd command line arguments are |
| 7 | +# correct |
| 8 | +RUN swupd update --no-boot-update $swupd_args |
| 9 | + |
| 10 | +# Grab os-release info from the minimal base image so |
| 11 | +# that the new content matches the exact OS version |
| 12 | +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / |
| 13 | + |
| 14 | +# Install additional content in a target directory |
| 15 | +# using the os version from the minimal base |
| 16 | +RUN source /os-release && \ |
| 17 | + mkdir /install_root \ |
| 18 | + && swupd os-install -V ${VERSION_ID} \ |
| 19 | + --path /install_root --statedir /swupd-state \ |
| 20 | + --bundles=os-core-update,php-basic --no-scripts |
| 21 | + |
| 22 | +# For some Host OS configuration with redirect_dir on, |
| 23 | +# extra data are saved on the upper layer when the same |
| 24 | +# file exists on different layers. To minimize docker |
| 25 | +# image size, remove the overlapped files before copy. |
| 26 | +RUN mkdir /os_core_install |
| 27 | +COPY --from=clearlinux/os-core:latest / /os_core_install/ |
| 28 | +RUN cd / && \ |
| 29 | + find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true |
| 30 | + |
| 31 | + |
| 32 | +FROM clearlinux/os-core:latest |
| 33 | + |
| 34 | +COPY --from=builder /install_root / |
| 35 | + |
| 36 | +RUN set -ex \ |
| 37 | + mkdir -p /var/www/html \ |
| 38 | + && cd /usr/share/defaults/php \ |
| 39 | + && { \ |
| 40 | + echo '[global]'; \ |
| 41 | + echo 'error_log = /proc/self/fd/2'; \ |
| 42 | + echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ |
| 43 | + echo; \ |
| 44 | + echo '[www]'; \ |
| 45 | + echo '; if we send this to /proc/self/fd/1, it never appears'; \ |
| 46 | + echo 'access.log = /proc/self/fd/2'; \ |
| 47 | + echo; \ |
| 48 | + echo 'clear_env = no'; \ |
| 49 | + echo; \ |
| 50 | + echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ |
| 51 | + echo 'catch_workers_output = yes'; \ |
| 52 | + echo 'decorate_workers_output = no'; \ |
| 53 | + } | tee php-fpm.d/docker.conf \ |
| 54 | + && { \ |
| 55 | + echo '[global]'; \ |
| 56 | + echo 'daemonize = no'; \ |
| 57 | + echo; \ |
| 58 | + echo '[www]'; \ |
| 59 | + echo 'listen = 9000'; \ |
| 60 | + } | tee php-fpm.d/zz-docker.conf |
| 61 | + |
| 62 | +WORKDIR /var/www/html |
| 63 | + |
| 64 | +COPY docker-php-entrypoint /usr/local/bin/ |
| 65 | +RUN chmod +x /usr/local/bin/docker-php-entrypoint |
| 66 | +ENTRYPOINT ["docker-php-entrypoint"] |
| 67 | + |
| 68 | +STOPSIGNAL SIGQUIT |
| 69 | + |
| 70 | +EXPOSE 9000 |
| 71 | +CMD ["php-fpm"] |
0 commit comments