Installing GCC from source on Alpine
It turns out that in this particular case one needs to install mpc1-dev, gmp-dev or mpfr-dev. I was missing out on mpc1-dev.
sudo apk add mpc1-dev
Install a specific GCC/G++ Version inside an Alpine Linux container
If you wish to use an older version of GCC, you can download the source from GCC 4.8.0
and then build gcc from source.
You can give all the commands as part of your Dockerfile and then build the alpine image with the required GCC. If you don't want to create image, you can simply follow the steps mentioned to build gcc in alpine container.
error: command 'gcc' failed with exit status 1 when installing pip packages on alpine docker image
Missing the header file Python.h
, this file is provide by python2-dev
( -dev
mean package for doing development with ) .
With this https://pkgs.alpinelinux.org/contents you can search all packages that have Python.h
I was able to run pip install pygpgme
by adding these 3 packages :
- python2-dev
- gpgme-dev
- libc-dev
And the Dockerfile
will be :
FROM alpine:latest
RUN apk update && apk upgrade
RUN apk add --no-cache bash\
python \
pkgconfig \
git \
gcc \
openldap \
libcurl \
python2-dev \
gpgme-dev \
libc-dev \
&& rm -rf /var/cache/apk/*
RUN wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
RUN pip install setuptools==30.1.0
Gdal installation in Alpine compilation failure - error: command 'gcc' failed with exit status 1
It seems there's a GDAL version conflict:
pip install gdal
pulls the sources tarball for GDAL 3.0.0 and attempts to build it from source;- The 2.4.0-r1
gdal-dev
package is being installed, which is indeed the latest available in Alpine repositories; - GDAL 3.0.0 won't build against the 2.4.0-r1
gdal-dev
headers.
As a workaround, installing the GDAL module of the matching version, 2.4.0, may be successful:
pip install 'gdal==2.4.0'
installing a GCC compiler onto a Docker Container
In your Dockerfile:
FROM ubuntu
# ...
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get -y install gcc mono-mcs && \
rm -rf /var/lib/apt/lists/*
Related Topics
Identify Program That Connects to a Unix Domain Socket
Bash Script That Creates a Directory Structure
Developing a Web App with Mono (Opensource .Net) Any Examples
Ssh Connection to Azure Vm with Terraform
Find The Number of Files in a Directory
Understanding Linux Directory Permissions Reasoning
How to Check If Jboss Is Running on Unix Server
Do Different Programs Gets Their Memory from a Common Heap or from a Separate Heap
Under What Circumstances Does The Read() Syscall Return 0
How to Block Push to Master Branch on Remote
Linux of Equivalent Cryptprotectmemory
How Does Linux Support More Than 512Gb of Virtual Address Range in X86-64
How to Check Out a Particular Version in Git from 'Git Log'