From 12ce1c5d4be7a3ae8f2af2a28e50c33e2c8edbbb Mon Sep 17 00:00:00 2001 From: Alex Barreto Date: Sat, 8 May 2021 17:31:12 -0400 Subject: [PATCH] Dockerfile_alpine: fix broken pip six installation (#1568) Fixes docker hub error: ``` Step 32/49 : RUN pip3 install --upgrade pip six grass-session ---> Running in 1c63e0d56789 Collecting pip Downloading pip-21.1.1-py3-none-any.whl (1.5 MB) Collecting six Downloading six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting grass-session Downloading grass_session-0.5-py2.py3-none-any.whl (31 kB) Installing collected packages: pip, six, grass-session Attempting uninstall: pip Found existing installation: pip 20.0.2 Uninstalling pip-20.0.2: Successfully uninstalled pip-20.0.2 Attempting uninstall: six Found existing installation: six 1.15.0 ERROR: Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. ``` --- CONTRIBUTING.md | 21 +++++++++++++++++++++ docker/alpine/Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7abb4594e65..51ce0dd90ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,24 @@ +# Introduction + +GRASS GIS is written in more than one programming language. While most +of the source code is written in C, about 30% is written in Python. A +compiler is needed to convert the C/C++ source code into executable +files ("binaries"). In contrast, Python is an interpreted language that +can only be executed with Python software. + +Now, in order to create an installable binary package from a source +code package, the so-called "compilation step" is required. While the +source code consists of thousands of C and Python files (plus HTML +documentation), the included "makefiles" tell the build system to +generate binaries from the source code in the correct order, render the +manual pages, etc. + +The way to install the compiler tools and Python depends on the operating +system. To make this easier, we have collected copy-paste instructions +for most operating systems in our wiki: + +[Compile and install instructions](https://grasswiki.osgeo.org/wiki/Compile_and_Install) + # Contributing There is more than one way of contributing to GRASS GIS. diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index ea463f5906a..73180e4a96f 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -189,6 +189,44 @@ RUN ./configure \ FROM common as grass +<<<<<<< HEAD:docker/alpine/Dockerfile +======= +ENV LC_ALL="en_US.UTF-8" + +# Copy GRASS GIS from build image +COPY --from=build /usr/local/bin/grass /usr/local/bin/grass +COPY --from=build /usr/local/grass* /usr/local/grass/ +# pip 20.0.0 fix +RUN apk add curl && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py pip==20.0.2 && rm get-pip.py + +# install external Python API +RUN pip3 install --upgrade grass-session + +RUN ln -s /usr/local/grass /usr/local/grass7 +RUN ln -s /usr/local/grass `grass --config path` +RUN grass --tmp-location EPSG:4326 --exec g.version -rge && \ + pdal --version && \ + python3 --version + + +FROM grass as test + +RUN apk add make gcc + +## run simple LAZ test +COPY docker/testdata/simple.laz /tmp/simple.laz +COPY docker/testdata/test_grass_session.py /scripts/test_grass_session.py +ENV GRASSBIN=grass +RUN grass --tmp-location EPSG:4326 --exec g.extension extension=r.in.pdal +RUN /usr/bin/python3 /scripts/test_grass_session.py + +# Test addon installation +RUN grass --tmp-location EPSG:4326 --exec g.extension extension=r.learn.ml + + +FROM grass as final + +>>>>>>> e526e86235 (Dockerfile_alpine: fix broken pip six installation (#1568)):docker/alpine/Dockerfile_alpine # GRASS GIS specific # allow work with MAPSETs that are not owned by current user ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \