Docker Community Forums

Share and learn in the Docker community.

Docker build fails with 'configure: error: C compiler cannot create executables'

(Lgiacomoni) #1


I am trying to extend a Docker image with some python modules that I need.

I have been trying to modify the Dockerfile that came with the image, but during building I get:

/tmp/build/PKGBUILD: line 26: patch: command not found

If I include patch in the libraries to download, I get another error:

configure: error: in `/tmp/build/src/graph-tool-2.26':
configure: error: C compiler cannot create executables

I am running Docker on macOS High Sierra (10.13.4) and Docker Version 18.03.1-ce-mac65.

Here is the Dockerfile:

# VERSION           2
FROM base/archlinux:latest
MAINTAINER Tiago de Paula Peixoto <>

RUN echo 'Server=$repo/os/$arch' > /etc/pacman.d/mirrorlist

RUN pacman-key --refresh-keys
RUN pacman -Syu --noconfirm
RUN pacman -S binutils make gcc patch fakeroot --noconfirm --needed
RUN pacman -S expac yajl git --noconfirm --needed
RUN pacman -S sudo grep file --noconfirm --needed

RUN pacman -S sudo boost python3 python3-scipy python3-numpy \
              cgal cairomm python-cairo sparsehash cairomm   \
	      autoconf-archive pkg-config --noconfirm --needed

    MAKEPKG_GROUP=mkpkg \

RUN groupadd "${MAKEPKG_USER}" \
    && useradd -g "${MAKEPKG_GROUP}" "${MAKEPKG_USER}"

RUN mkdir -p ${MAKEPKG_ROOT}; chown mkpkg:mkpkg ${MAKEPKG_ROOT}


RUN makepkg PKGBUILD --install --needed CXXFLAGS="-mtune=generic -O3 -pipe -flto=4 -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections"

USER root
RUN pacman -U python-graph-tool-*-x86_64.pkg.tar.xz --noconfirm --needed


RUN rm -rf ${MAKEPKG_ROOT}/*

RUN pacman -S python-pip ipython gtk3 python-gobject python-matplotlib python-pandas jupyter-notebook mathjax python-cairocffi pandoc python-pymongo --noconfirm --needed

RUN useradd -m -g users user

What I am really interested in is a way to include python modules in the image so that I do not have to install them every time I start a new container. Any suggestion is very much appreciated.

Thanks a lot,

(Alexhha) #2

It’s because graph-tool trying to find At least in my case. I got the following error message in config.log

/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/cc1: error while loading shared libraries: cannot open shared object file: No such file or directory

As a temporary workaround you can add the following line to the Dockerfile

RUN mkdir -p ${MAKEPKG_ROOT}; chown mkpkg:mkpkg ${MAKEPKG_ROOT} \
&& cd /usr/lib/ && ln -s

Yoy can take a look on complete Dockerfile -