Hello,
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 <tiago@skewed.de>
RUN echo 'Server=https://archive.archlinux.org/repos/2017/11/23/$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
ENV MAKEPKG_USER=mkpkg \
MAKEPKG_GROUP=mkpkg \
MAKEPKG_ROOT=/tmp/build
RUN groupadd "${MAKEPKG_USER}" \
&& useradd -g "${MAKEPKG_GROUP}" "${MAKEPKG_USER}"
RUN mkdir -p ${MAKEPKG_ROOT}; chown mkpkg:mkpkg ${MAKEPKG_ROOT}
WORKDIR ${MAKEPKG_ROOT}
USER ${MAKEPKG_USER}
RUN curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=python-graph-tool
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
WORKDIR /root
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,
Luca