Skip to content

Commit

Permalink
Dockerfile_alpine: fix broken pip six installation (OSGeo#1568)
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
a0x8o committed Jul 31, 2024
1 parent afc6079 commit 12ce1c5
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
38 changes: 38 additions & 0 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 12ce1c5

Please sign in to comment.