docker-alpine-nginx-pagespeed icon indicating copy to clipboard operation
docker-alpine-nginx-pagespeed copied to clipboard

Project error

Open nabad600 opened this issue 5 years ago • 13 comments
trafficstars

Hi, Thanks for your project but error showing ./configure: error: no /tmp/ngx_pagespeed-1.11.33.4-beta/config was found

nabad600 avatar Jul 25 '20 15:07 nabad600

I admit I should update it, it's just very painful to maintain this one.

wernight avatar Jul 29 '20 13:07 wernight

@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).

oschaaf avatar Jul 29 '20 13:07 oschaaf

(For master, I suspect taking https://hub.docker.com/r/envoyproxy/envoy-alpine as a base could be convenient)

oschaaf avatar Jul 29 '20 13:07 oschaaf

FWIW, there's no one with proper docker knowledge/experience involved in maintaining the apache ones, and help is surely welcome there :-)

oschaaf avatar Jul 29 '20 13:07 oschaaf

(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.

wernight avatar Jul 29 '20 21:07 wernight

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)

oschaaf avatar Jul 29 '20 22:07 oschaaf

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 :-)

oschaaf avatar Jul 29 '20 22:07 oschaaf

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

wernight avatar Jul 29 '20 22:07 wernight

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.

wernight avatar Jul 29 '20 23:07 wernight

@oschaaf Once there is a release with PSOL source code, I'll try again to compile PSOL.

wernight avatar Jul 31 '20 11:07 wernight

Well, there's psol-1.14.36.1-apache-incubating-x64.tar.gz

oschaaf avatar Jul 31 '20 11:07 oschaaf

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/

oschaaf avatar Jul 31 '20 11:07 oschaaf

Thank you. Btw. I replied on https://github.com/apache/incubator-pagespeed-mod/pull/2021

wernight avatar Jul 31 '20 18:07 wernight