docker-alpine-nginx-pagespeed
docker-alpine-nginx-pagespeed copied to clipboard
Project error
Hi, Thanks for your project but error showing ./configure: error: no /tmp/ngx_pagespeed-1.11.33.4-beta/config was found
I admit I should update it, it's just very painful to maintain this one.
@wernight there's also https://github.com/apache/incubator-pagespeed-ngx/tree/master/docker On mod_pagespeed's master, we've ported the build to use bazel instead of gyp and lean more on absl/Envoy. That actually might make life easier (but I'd have to try and see if that holds). Also, 1.14 was released as a first apache incubator release. (not announced yet).
(For master, I suspect taking https://hub.docker.com/r/envoyproxy/envoy-alpine as a base could be convenient)
FWIW, there's no one with proper docker knowledge/experience involved in maintaining the apache ones, and help is surely welcome there :-)
(For master, I suspect taking https://hub.docker.com/r/envoyproxy/envoy-alpine as a base could be convenient)
I'm really reluctant to use a base image that is not an official OS of Docker Hub and that doesn't even show its sources, for a web server. That's a clear no no.
The Dockerfile you pointed out is useful, however it's 2 years old. After trying a bit, the main issue is that the documentation regarding how to build manually fails with weird errors on Alpine. It says that it cannot find PSOL. The real reason which is hidden is that ld cannot find many musl dependencies (basically LIBC which Alpine doesn't have).
Falling back to building PSOL is badly documented and relying on so many things it should not: bash, lsb_release... Just cloning from git.apache.org is so slow that it often times out which worries me for building this even if I manage to write a Dockerfile.
On https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source (which I cannot edit), I'd suggest to replace for example:
wget ${psol_url}
tar -xzvf $(basename ${psol_url}) # extracts to psol/
by
wget -O- ${psol_url} | tar -xzv # extracts to psol/
Much easier to read and execute.
I can add that, but it's also possible to propose it over at: https://github.com/apache/incubator-pagespeed-mod/tree/master/html (modpagespeed.com mirrors that)
Regarding Envoy's docker images, I think they are available via https://github.com/envoyproxy/envoy/tree/master/ci (the continuous integration pushes them). But I wasn't lying when I said I'm not expert here, so just pointing it out; if it's useful -- I'll leave that up to you :-)
What if ngx_pagespeed as provided as an AppImage? I'm not sure but it might work on Alpine then without almost any work. https://github.com/AppImage/AppImageKit/issues/1015
I'll update the dev branch with what I currently have.
Looks like PSOL uses fortied LIBC which isn't implemented on Alpine: https://stackoverflow.com/questions/55246192/musl-gcc-undefined-reference-to-memcpy-chk. Building PSOL says it cannot handle Alpine distro. So overall at the moment PSOL is giving me the most trouble.
For reference here is that basic Dockerfile:
FROM alpine:3.12
RUN set -x \
&& apk add ---no-cache -t .build-deps \
g++ \
libc6-compat \
make \
pcre-dev \
util-linux-dev \
zlib-dev \
# Download PageSpeed (and PSOL).
&& wget -O- https://github.com/apache/incubator-pagespeed-ngx/archive/${PAGESPEED_VERSION}.tar.gz | tar -xzC /tmp \
&& mv /tmp/incubator-pagespeed-ngx-* /tmp/ngx_pagespeed \
&& cd $_ \
&& PSOL_BINARY_URL=$(sh scripts/format_binary_url.sh PSOL_BINARY_URL) \
&& wget -O- ${PSOL_BINARY_URL} | tar -xz \
# Build Nginx with support for PageSpeed.
&& wget -O- http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | tar -xzC /tmp \
&& cd /tmp/nginx-* \
&& ./configure --add-module=/tmp/ngx_pagespeed \
&& make install --silent
One more issue regarding build PSOL: The latest release does not seem to have submodules defined: https://github.com/apache/incubator-pagespeed-ngx/blob/v1.13.35.2-stable/.gitmodules
So it looks like either need to guess a compatible PSOL, or build from latest snapshot. Neither are good options.
@oschaaf Once there is a release with PSOL source code, I'll try again to compile PSOL.
Well, there's psol-1.14.36.1-apache-incubating-x64.tar.gz
Sorry - that went out too early; I wanted to point to https://dist.apache.org/repos/dist/release/incubator/pagespeed/1.14.36.1/x64/
Thank you. Btw. I replied on https://github.com/apache/incubator-pagespeed-mod/pull/2021