Docker Usage: docker build #2

Closed
opened 2024-06-27 15:52:53 +02:00 by dancingCycle · 6 comments

Hi,
Thank you so much for providing and maintaining this repository!

According to the README I called the following instructions.

mv ~/Downloads/PLZ_Gebiete_-7531060512283041383.geojson .
touch wtf_member_plz_prefixes.json
vi wtf_member_plz_prefixes.json 
mv PLZ_Gebiete_-7531060512283041383.geojson Postleitzahlengebiete_-_OSM.geojson
docker build -t wtf-map .

Instead of the build I received this reply.

[+] Building 150.5s (12/14)                                                                                                               docker:default  => [internal] load build definition from Dockerfile                                                                                                0.0s
 => => transferring dockerfile: 739B                                                                                                                0.0s  => [internal] load metadata for docker.io/library/ubuntu:22.04                                                                                     0.4s
 => [internal] load .dockerignore                                                                                                                   0.0s  => => transferring context: 2B                                                                                                                     0.0s
 => [ 1/10] FROM docker.io/library/ubuntu:22.04@sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852aac1ac                             9.4s  => => resolve docker.io/library/ubuntu:22.04@sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852aac1ac                               0.0s
 => => sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852aac1ac 1.13kB / 1.13kB                                                      0.0s 
 => => sha256:94db6b944510db19c0ff5eb13281cf166abfe6f9e01a6f8e716e976664537c60 424B / 424B                                                          0.0s 
 => => sha256:67c845845b7de8024a1ad9f6e7fd08964502a0b423aa8de631ef521863873884 2.30kB / 2.30kB                                                      0.0s 
 => => sha256:7646c8da332499ae416b15479ce832db32e39a501c662e24324f595509a0d3db 29.53MB / 29.53MB                                                    8.5s 
 => => extracting sha256:7646c8da332499ae416b15479ce832db32e39a501c662e24324f595509a0d3db                                                           0.7s 
 => [internal] load build context                                                                                                                   0.9s 
 => => transferring context: 166.61MB                                                                                                               0.9s 
 => [ 2/10] RUN apt-get update && apt-get install libblas-dev python3-pip libgeos-dev wget optipng imagemagick -y                                 102.0s 
 => [ 3/10] COPY requirements.txt ./                                                                                                                0.0s
 => [ 4/10] RUN pip install -r requirements.txt                                                                                                    37.4s
 => [ 5/10] COPY Postleitzahlengebiete_-_OSM.geojson ./                                                                                             0.2s
 => [ 6/10] COPY wtf_member_plz_prefixes.json ./                                                                                                    0.1s
 => [ 7/10] COPY main.py ./                                                                                                                         0.1s
 => ERROR [ 8/10] RUN python3 main.py --plz-data Postleitzahlengebiete_-_OSM.geojson --plz-highlight wtf_member_plz_prefixes.json --out /tmp/map.p  0.9s
------
 > [ 8/10] RUN python3 main.py --plz-data Postleitzahlengebiete_-_OSM.geojson --plz-highlight wtf_member_plz_prefixes.json --out /tmp/map.png:
0.778 
0.778 A module that was compiled using NumPy 1.x cannot be run in
0.778 NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
0.778 versions of NumPy, modules must be compiled with NumPy 2.0.
0.778 Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
0.778 
0.778 If you are a user of the module, the easiest solution will be to
0.778 downgrade to 'numpy<2' or try to upgrade the affected module.
0.778 We expect that some modules will need time to support NumPy 2.
0.778 
0.778 Traceback (most recent call last):  File "//main.py", line 5, in <module>
0.778     import matplotlib.pyplot as plt
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/__init__.py", line 113, in <module>
0.778     from . import _api, _version, cbook, _docstring, rcsetup
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/rcsetup.py", line 27, in <module>
0.778     from matplotlib.colors import Colormap, is_color_like
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/colors.py", line 56, in <module>
0.778     from matplotlib import _api, _cm, cbook, scale
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/scale.py", line 22, in <module>
0.778     from matplotlib.ticker import (
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/ticker.py", line 138, in <module>
0.778     from matplotlib import transforms as mtransforms
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/transforms.py", line 49, in <module>
0.778     from matplotlib._path import (
0.778 AttributeError: _ARRAY_API not found
0.778 Traceback (most recent call last):
0.778   File "//main.py", line 5, in <module>
0.778     import matplotlib.pyplot as plt
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/__init__.py", line 113, in <module>
0.778     from . import _api, _version, cbook, _docstring, rcsetup
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/rcsetup.py", line 27, in <module>
0.778     from matplotlib.colors import Colormap, is_color_like
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/colors.py", line 56, in <module>
0.778     from matplotlib import _api, _cm, cbook, scale
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/scale.py", line 22, in <module>
0.778     from matplotlib.ticker import (
0.778   File "/usr/local/lib/python3.10/dist-packages/matplotlib/ticker.py", line 138, in <module>
0.779     from matplotlib import transforms as mtransforms
0.779   File "/usr/local/lib/python3.10/dist-packages/matplotlib/transforms.py", line 49, in <module>
0.779     from matplotlib._path import (
0.779 ImportError: numpy.core.multiarray failed to import
------
Dockerfile:17
--------------------
  15 |     # Render map
  16 |     COPY main.py ./
  17 | >>> RUN python3 main.py --plz-data $PLZ_DATA --plz-highlight $PLZ_HIGHLIGHT --out /tmp/map.png
  18 |     
  19 |     RUN convert -fuzz 5 -trim /tmp/map.png /tmp/map.png
--------------------
ERROR: failed to solve: process "/bin/sh -c python3 main.py --plz-data $PLZ_DATA --plz-highlight $PLZ_HIGHLIGHT --out /tmp/map.png" did not complete successfully: exit code: 1

Is this reply expected behavior?

FYI

$ docker --version
Docker version 27.0.2, build 912c1dd

Cheers!

Hi, Thank you so much for providing and maintaining this repository! According to the [README](https://git.wtf-eg.de/Gro/member-map/src/commit/6344bc13827c7036d2abb9fb788456e65f8149a3/README.md?display=source#L17) I called the following instructions. ``` mv ~/Downloads/PLZ_Gebiete_-7531060512283041383.geojson . touch wtf_member_plz_prefixes.json vi wtf_member_plz_prefixes.json mv PLZ_Gebiete_-7531060512283041383.geojson Postleitzahlengebiete_-_OSM.geojson docker build -t wtf-map . ``` Instead of the build I received this reply. ``` [+] Building 150.5s (12/14) docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 739B 0.0s => [internal] load metadata for docker.io/library/ubuntu:22.04 0.4s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [ 1/10] FROM docker.io/library/ubuntu:22.04@sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852aac1ac 9.4s => => resolve docker.io/library/ubuntu:22.04@sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852aac1ac 0.0s => => sha256:19478ce7fc2ffbce89df29fea5725a8d12e57de52eb9ea570890dc5852aac1ac 1.13kB / 1.13kB 0.0s => => sha256:94db6b944510db19c0ff5eb13281cf166abfe6f9e01a6f8e716e976664537c60 424B / 424B 0.0s => => sha256:67c845845b7de8024a1ad9f6e7fd08964502a0b423aa8de631ef521863873884 2.30kB / 2.30kB 0.0s => => sha256:7646c8da332499ae416b15479ce832db32e39a501c662e24324f595509a0d3db 29.53MB / 29.53MB 8.5s => => extracting sha256:7646c8da332499ae416b15479ce832db32e39a501c662e24324f595509a0d3db 0.7s => [internal] load build context 0.9s => => transferring context: 166.61MB 0.9s => [ 2/10] RUN apt-get update && apt-get install libblas-dev python3-pip libgeos-dev wget optipng imagemagick -y 102.0s => [ 3/10] COPY requirements.txt ./ 0.0s => [ 4/10] RUN pip install -r requirements.txt 37.4s => [ 5/10] COPY Postleitzahlengebiete_-_OSM.geojson ./ 0.2s => [ 6/10] COPY wtf_member_plz_prefixes.json ./ 0.1s => [ 7/10] COPY main.py ./ 0.1s => ERROR [ 8/10] RUN python3 main.py --plz-data Postleitzahlengebiete_-_OSM.geojson --plz-highlight wtf_member_plz_prefixes.json --out /tmp/map.p 0.9s ------ > [ 8/10] RUN python3 main.py --plz-data Postleitzahlengebiete_-_OSM.geojson --plz-highlight wtf_member_plz_prefixes.json --out /tmp/map.png: 0.778 0.778 A module that was compiled using NumPy 1.x cannot be run in 0.778 NumPy 2.0.0 as it may crash. To support both 1.x and 2.x 0.778 versions of NumPy, modules must be compiled with NumPy 2.0. 0.778 Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. 0.778 0.778 If you are a user of the module, the easiest solution will be to 0.778 downgrade to 'numpy<2' or try to upgrade the affected module. 0.778 We expect that some modules will need time to support NumPy 2. 0.778 0.778 Traceback (most recent call last): File "//main.py", line 5, in <module> 0.778 import matplotlib.pyplot as plt 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/__init__.py", line 113, in <module> 0.778 from . import _api, _version, cbook, _docstring, rcsetup 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/rcsetup.py", line 27, in <module> 0.778 from matplotlib.colors import Colormap, is_color_like 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/colors.py", line 56, in <module> 0.778 from matplotlib import _api, _cm, cbook, scale 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/scale.py", line 22, in <module> 0.778 from matplotlib.ticker import ( 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/ticker.py", line 138, in <module> 0.778 from matplotlib import transforms as mtransforms 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/transforms.py", line 49, in <module> 0.778 from matplotlib._path import ( 0.778 AttributeError: _ARRAY_API not found 0.778 Traceback (most recent call last): 0.778 File "//main.py", line 5, in <module> 0.778 import matplotlib.pyplot as plt 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/__init__.py", line 113, in <module> 0.778 from . import _api, _version, cbook, _docstring, rcsetup 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/rcsetup.py", line 27, in <module> 0.778 from matplotlib.colors import Colormap, is_color_like 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/colors.py", line 56, in <module> 0.778 from matplotlib import _api, _cm, cbook, scale 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/scale.py", line 22, in <module> 0.778 from matplotlib.ticker import ( 0.778 File "/usr/local/lib/python3.10/dist-packages/matplotlib/ticker.py", line 138, in <module> 0.779 from matplotlib import transforms as mtransforms 0.779 File "/usr/local/lib/python3.10/dist-packages/matplotlib/transforms.py", line 49, in <module> 0.779 from matplotlib._path import ( 0.779 ImportError: numpy.core.multiarray failed to import ------ Dockerfile:17 -------------------- 15 | # Render map 16 | COPY main.py ./ 17 | >>> RUN python3 main.py --plz-data $PLZ_DATA --plz-highlight $PLZ_HIGHLIGHT --out /tmp/map.png 18 | 19 | RUN convert -fuzz 5 -trim /tmp/map.png /tmp/map.png -------------------- ERROR: failed to solve: process "/bin/sh -c python3 main.py --plz-data $PLZ_DATA --plz-highlight $PLZ_HIGHLIGHT --out /tmp/map.png" did not complete successfully: exit code: 1 ``` Is this reply expected behavior? FYI ``` $ docker --version Docker version 27.0.2, build 912c1dd ``` Cheers!
Owner

Sorry for the inconvenience. My analysis has brought up the following concerns:

  • explicitly installing the system dependency libgdal-dev is required
  • numpy version 2.0 was released recently, which we need to fix to the last 1.* release to work with the other pinned dependencies (we can look at updating all dependencies to the most recent version as a follow up)
  • the data schema for the linked geojson dataset of Germany seems to have changed, no longer including the "bundesland" feature

The first two are easy to fix. The last one we'd need to check and see how to get the information which post code is part of which state if it's no longer included in that dataset. Do you know of a geojson dataset that has both, plz areas and state information?

Sorry for the inconvenience. My analysis has brought up the following concerns: - explicitly installing the system dependency `libgdal-dev` is required - numpy version 2.0 was released recently, which we need to fix to the last 1.* release to work with the other pinned dependencies (we can look at updating all dependencies to the most recent version as a follow up) - the data schema for the linked geojson dataset of Germany seems to have changed, no longer including the "bundesland" feature The first two are easy to fix. The last one we'd need to check and see how to get the information which post code is part of which state if it's no longer included in that dataset. Do you know of a geojson dataset that has both, plz areas and state information?
Author

Hi @Gro ,

The first two are easy to fix. The last one we'd need to check and see how to get the information which post code is part of which state if it's no longer included in that dataset. Do you know of a geojson dataset that has both, plz areas and state information?

Would it be an alternative, or byepass for the meantime, to render the map without the state borders?

Hi @Gro , > The first two are easy to fix. The last one we'd need to check and see how to get the information which post code is part of which state if it's no longer included in that dataset. Do you know of a geojson dataset that has both, plz areas and state information? Would it be an alternative, or byepass for the meantime, to render the map without the state borders?
Owner

Sure, I'll do that to get back to a working state quickly. It won't help to reproduce the map on https://wtf-eg.de/, though.
Did you have a specific goal in mind when you tried running the code, or just playing around with it?

Sure, I'll do that to get back to a working state quickly. It won't help to reproduce the map on https://wtf-eg.de/, though. Did you have a specific goal in mind when you tried running the code, or just playing around with it?
Author

Did you have a specific goal in mind when you tried running the code, or just playing around with it?

Yup. I wanted to get it running. Afterwards I am wondering if I can apply it to the members of my hosting cooperative.

> Did you have a specific goal in mind when you tried running the code, or just playing around with it? Yup. I wanted to get it running. Afterwards I am wondering if I can apply it to the members of my [hosting cooperative](https://www.hostsharing.net/).
Owner

Could you try out #3 please, @dancingCycle?

Could you try out #3 please, @dancingCycle?
Author

Could you try out #3 please, @dancingCycle?

$ docker build -t wtf-map .
$ docker run wtf-map > map.png
$ ls -l map.png 
-rw-r--r-- 1 begerad begerad 64809 Jun 28 08:35 map.png

Nice workaround. Well done!

> Could you try out #3 please, @dancingCycle? ``` $ docker build -t wtf-map . $ docker run wtf-map > map.png $ ls -l map.png -rw-r--r-- 1 begerad begerad 64809 Jun 28 08:35 map.png ``` Nice workaround. Well done!
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gro/member-map#2
No description provided.