3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
254 stars 143 forks source link

[Question]: Building a new image #3126

Closed sincorchetes closed 1 year ago

sincorchetes commented 2 years ago

What is the question?

How I can build a new image? NOTE: In the first place, 3.16 and 3.15 uses composer with php8. It does not work with php7 modules, so, you need use 3.14

Steps:

  1. Clone git@github.com:3liz/lizmap-web-client.git
  2. cd lizmap-web-client/docker
  3. docker build .
    Sending build context to Docker daemon  10.84MB
    Step 1/20 : ARG REGISTRY_PREFIX=''
    Step 2/20 : FROM ${REGISTRY_PREFIX}alpine:3.14 as build
    ---> d7d3d98c851f
    Step 3/20 : COPY lizmap_web_client.zip .
    COPY failed: file not found in build context or excluded by .dockerignore: stat lizmap_web_client.zip: file does not exist

    Ok, thinking...

    wget https://github.com/3liz/lizmap-web-client/releases/download/3.5.4/lizmap-web-client-3.5.4.zip
    mv lizmap-web-client-3.5.4.zip lizmap_web_client.zip

Running docker build once:

Sending build context to Docker daemon  21.65MB
Step 1/20 : ARG REGISTRY_PREFIX=''
Step 2/20 : FROM ${REGISTRY_PREFIX}alpine:3.14 as build
 ---> d7d3d98c851f
Step 3/20 : COPY lizmap_web_client.zip .
 ---> Using cache
 ---> 380463b8572a
Step 4/20 : RUN unzip lizmap_web_client.zip
 ---> Using cache
 ---> 1c12b90b81c0
Step 5/20 : FROM ${REGISTRY_PREFIX}alpine:3.14
 ---> d7d3d98c851f
Step 6/20 : MAINTAINER David Marteau <david.marteau@3liz.com>
 ---> Using cache
 ---> 2ad3249ffa42
Step 7/20 : LABEL Description="Lizmap web client" Vendor="3liz.org" Version="22.06.0"
 ---> Using cache
 ---> 4806f10d7bb0
Step 8/20 : RUN apk update && apk upgrade &&     apk --no-cache add git fcgi php7     php7-ctype     php7-curl     php7-dom     php7-exif     php7-fileinfo     php7-fpm     php7-gd     php7-gettext     php7-iconv     php7-intl     php7-json     php7-ldap     php7-mbstring     php7-opcache     php7-openssl     php7-pgsql     php7-phar     php7-redis     php7-session     php7-simplexml     php7-sqlite3     php7-tokenizer     php7-xml     php7-xmlreader     php7-xmlwriter     php7-zip     composer
 ---> Using cache
 ---> 25ee3af93496
Step 9/20 : COPY --from=build /lizmap_web_client /www
COPY failed: stat lizmap_web_client: file does not exist

OK, I have to perform some steps before to build:

mv lizmap_web_client.zip lizmap_web_client-root.zip
unzip lizmap_web_client-root.zip
mv lizmap-web-client-3.5.4/ lizmap_web_client
zip -r lizmap_web_client.zip lizmap_web_client

Building an image:

docker build .
Sending build context to Docker daemon  67.22MB

Step 1/20 : ARG REGISTRY_PREFIX=''
Step 2/20 : FROM ${REGISTRY_PREFIX}alpine:3.14 as build
 ---> 5977be310a9d
Step 3/20 : COPY lizmap_web_client.zip .
 ---> Using cache
 ---> f05e46d65dea
Step 4/20 : RUN unzip lizmap_web_client.zip
 ---> Using cache
 ---> 05a8f6d1fc63
Step 5/20 : FROM ${REGISTRY_PREFIX}alpine:3.14
 ---> 5977be310a9d
Step 6/20 : MAINTAINER David Marteau <david.marteau@3liz.com>
 ---> Using cache
 ---> fdbb73564dd3
Step 7/20 : LABEL Description="Lizmap web client" Vendor="3liz.org" Version="22.06.0"
 ---> Using cache
 ---> 03a3ce7250f6
Step 8/20 : RUN apk update && apk upgrade &&     apk --no-cache add git fcgi php7     php7-ctype     php7-curl     php7-dom     php7-exif     php7-fileinfo     php7-fpm     php7-gd     php7-gettext     php7-iconv     php7-intl     php7-json     php7-ldap     php7-mbstring     php7-opcache     php7-openssl     php7-pgsql     php7-phar     php7-redis     php7-session     php7-simplexml     php7-sqlite3     php7-tokenizer     php7-xml     php7-xmlreader     php7-xmlwriter     php7-zip     composer
 ---> Using cache
 ---> 0a19ef50ee9c
Step 9/20 : COPY --from=build /lizmap_web_client /www
 ---> Using cache
 ---> d1aa1445803c
Step 10/20 : RUN mv /www/lizmap/var/config /www/lizmap/var/config.dist  && mv /www/lizmap/www /www/lizmap/www.dist  && mv /www/lizmap/my-packages/composer.json.dist /my-packages.composer.json.dist
 ---> Using cache
 ---> 24b885873a34
Step 11/20 : COPY factory.manifest /build.manifest
COPY failed: file not found in build context or excluded by .dockerignore: stat factory.manifest: file does not exist

So, you need to edit the Dockerfile and remove the factory.manifest.

Sending build context to Docker daemon  67.22MB
Step 1/19 : ARG REGISTRY_PREFIX=''
Step 2/19 : FROM ${REGISTRY_PREFIX}alpine:3.14 as build
 ---> 5977be310a9d
Step 3/19 : COPY lizmap_web_client.zip .
 ---> Using cache
 ---> f05e46d65dea
Step 4/19 : RUN unzip lizmap_web_client.zip
 ---> Using cache
 ---> 05a8f6d1fc63
Step 5/19 : FROM ${REGISTRY_PREFIX}alpine:3.14
 ---> 5977be310a9d
Step 6/19 : MAINTAINER David Marteau <david.marteau@3liz.com>
 ---> Using cache
 ---> fdbb73564dd3
Step 7/19 : LABEL Description="Lizmap web client" Vendor="3liz.org" Version="22.06.0"
 ---> Using cache
 ---> 03a3ce7250f6
Step 8/19 : RUN apk update && apk upgrade &&     apk --no-cache add git fcgi php7     php7-ctype     php7-curl     php7-dom     php7-exif     php7-fileinfo     php7-fpm     php7-gd     php7-gettext     php7-iconv     php7-intl     php7-json     php7-ldap     php7-mbstring     php7-opcache     php7-openssl     php7-pgsql     php7-phar     php7-redis     php7-session     php7-simplexml     php7-sqlite3     php7-tokenizer     php7-xml     php7-xmlreader     php7-xmlwriter     php7-zip     composer
 ---> Using cache
 ---> 0a19ef50ee9c
Step 9/19 : COPY --from=build /lizmap_web_client /www
 ---> Using cache
 ---> d1aa1445803c
Step 10/19 : RUN mv /www/lizmap/var/config /www/lizmap/var/config.dist  && mv /www/lizmap/www /www/lizmap/www.dist  && mv /www/lizmap/my-packages/composer.json.dist /my-packages.composer.json.dist
 ---> Using cache
 ---> 24b885873a34
Step 11/19 : COPY lizmap-entrypoint.sh update-config.php /bin/
 ---> e8d0c8aff50a
Step 12/19 : COPY scripts/* /usr/local/bin/
 ---> d2890feec0fa
Step 13/19 : COPY php-fpm-healthcheck /usr/local/bin/
 ---> ce51836046d4
Step 14/19 : RUN chmod 755 /bin/lizmap-entrypoint.sh /bin/update-config.php /usr/local/bin/php-fpm-healthcheck
 ---> Running in 5296458a4c63
Removing intermediate container 5296458a4c63
 ---> f4d3df443290
Step 15/19 : ENV PHP_INI_DIR /etc/php7
 ---> Running in 6b60255aa1ff
Removing intermediate container 6b60255aa1ff
 ---> b40ba820eec9
Step 16/19 : HEALTHCHECK --interval=60s --timeout=30s CMD php-fpm-healthcheck || exit 1
 ---> Running in 8c6b182c99e5
Removing intermediate container 8c6b182c99e5
 ---> 3288df6169df
Step 17/19 : WORKDIR /www
 ---> Running in b720b2531529
Removing intermediate container b720b2531529
 ---> 0bdde04163f8
Step 18/19 : ENTRYPOINT ["/bin/lizmap-entrypoint.sh"]
 ---> Running in ceb2b7e50e8b
Removing intermediate container ceb2b7e50e8b
 ---> 720451552c80
Step 19/19 : CMD ["/usr/sbin/php-fpm8", "-F", "-O"]
 ---> Running in ebd86058e90e
Removing intermediate container ebd86058e90e
 ---> 487e0aba6a6a
Successfully built 487e0aba6a6a

You can test this image (https://hub.docker.com/repository/docker/sincorchetes/lizmap-web-client):

docker pull sincorchetes/lizmap-web-client:3.5-php7

Versions

Latest version released

Check Lizmap plugin

QGIS server version, only if the section above doesn't mention the QGIS Server version

No response

Operating system

Gentoo Linux

Browsers

Chrome

Browsers version

Not relevant for this

Relevant log output

No response

3liz-bot commented 1 year ago

Hiya! This issue has gone quiet. 👻 We get a few questions in the bug tracker, so we currently slowly closing issues. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Thanks for being a part of the Lizmap community! 🦎