<div dir="ltr">I made a Dockerfile two years ago with a GDAL 2.2.3 install that was working fineĀ ultil three weeks ago, when I made a change in my Python code (not Dockerfile), but when I tried to build the image I got an errorĀ installing GDAL.<div>I am using a python:3.7 default image from Docker and I have the following lines to install GDAL:<br><div style="color:rgb(0,0,0);background-color:rgb(255,255,254);line-height:18px;white-space:pre"><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(160,160,160);font-style:italic"># Install GDAL dependencies</span></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">RUN</span> apt-get install -y python3-pip libgdal-dev locales</div><font face="SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, monospace" style="font-size:13px"><br></font><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(160,160,160);font-style:italic"># Ensure locales configured correctly</span></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">RUN</span> locale-gen en_US.UTF-8</div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">ENV</span> <span style="color:rgb(0,89,223)">LC_ALL</span>=<span style="color:rgb(191,38,0)">'en_US.utf8'</span></div><font face="SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, monospace" style="font-size:13px"><br></font><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(160,160,160);font-style:italic"># Set python aliases for python3</span></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">RUN</span> echo <span style="color:rgb(191,38,0)">'alias python=python3'</span> >> ~/.bashrc</div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">RUN</span> echo <span style="color:rgb(191,38,0)">'alias pip=pip3'</span> >> ~/.bashrc</div><font face="SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, monospace" style="font-size:13px"><br></font><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(160,160,160);font-style:italic"># Update C env vars so compiler can find gdal</span></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">ENV</span> <span style="color:rgb(0,89,223)">CPLUS_INCLUDE_PATH</span>=/usr/include/gdal</div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">ENV</span> <span style="color:rgb(0,89,223)">C_INCLUDE_PATH</span>=/usr/include/gdal</div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><br></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><span style="color:rgb(9,30,66);font-weight:bold">RUN</span> pip3 install GDAL==2.2.3</div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><br></div><div style=""><font face="arial, sans-serif" style="">When I try to build the image, I get the following error message:</font></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace">ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9sbmiien/gdal_b1debd2d108d43f38c9919e931126904/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9sbmiien/gdal_b1debd2d108d43f38c9919e931126904/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-sp2ip9vm/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/GDAL Check the logs for full command output.<br></div><div style="font-size:13px;font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace"><br></div><div style="font-size:13px"><font face="arial, sans-serif">Does anyone know what is happening and some way to make the installation work? Thank you!</font></div><div style="font-size:13px"><font face="arial, sans-serif"><br></font></div><div style="font-size:13px"><font face="arial, sans-serif">Best regards,</font></div><div style="font-size:13px"><font face="arial, sans-serif">Matheus</font></div></div></div></div>