I am currently trying to setup a Gazebo Simulation with Docker.Since i want to use a custom Gazebo Version made by Alessio Rocchi I am building everything from source. But while trying to build everything, i get the following error code:
cc1plus: warning: /tmp/gazebo/deps/klampt/Simulation/include: No such file or directory
cc1plus: warning: /etc/klampt/Library/KrisLibrary: No such file or directory
In file included from /tmp/gazebo/deps/klampt/Simulation/ODECustomGeometry.cpp:1:0:
/tmp/gazebo/deps/klampt/Simulation/ODECustomGeometry.h:4:34: fatal error: geometry/AnyGeometry.h: No such file or directory
#include <geometry/AnyGeometry.h>
^
compilation terminated.
deps/klampt/CMakeFiles/gazebo_klampt.dir/build.make:54: recipe for target 'deps/klampt/CMakeFiles/gazebo_klampt.dir/Simulation/ODECustomGeometry.cpp.o' failed
make[2]: *** [deps/klampt/CMakeFiles/gazebo_klampt.dir/Simulation/ODECustomGeometry.cpp.o] Error 1
CMakeFiles/Makefile2:388: recipe for target 'deps/klampt/CMakeFiles/gazebo_klampt.dir/all' failed
make[1]: *** [deps/klampt/CMakeFiles/gazebo_klampt.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
I am guessing it is more a CMake fault than a Docker fault, but i still don't manage to find a way around it. Maybe somebody can point out my probably fairly obvious errors.
FROM stevekuznetsov/klampt:latest
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu vivid main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
RUN apt-get update
RUN apt-get -y install ros-jade-desktop-full
RUN sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable vivid main" > /etc/apt/sources.list.d/gazebo-stable.list'
RUN apt-get -y install wget
RUN wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
RUN apt-get update
RUN wget https://bitbucket.org/osrf/release-tools/raw/default/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh
RUN apt-get -y install build-essential \
cmake \
mercurial
RUN hg clone https://bitbucket.org/ignitionrobotics/ign-math /tmp/ign-math
RUN cd /tmp/ign-math && \
hg up ign-math2 && \
mkdir build && \
cd build && \
cmake ../ && \
make -j4 && \
make install
RUN apt-get -y install build-essential \
cmake \
mercurial \
python \
libboost-system-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-iostreams-dev \
libtinyxml-dev \
libxml2-utils \
ruby-dev \
ruby
RUN hg clone https://bitbucket.org/osrf/sdformat /tmp/sdformat
RUN cd /tmp/sdformat && \
hg up sdf3 && \
mkdir build && \
cd build && \
cmake ../ && \
make -j4 && \
make install
RUN hg clone https://lpuck#bitbucket.org/arocchi/gazebo ./tmp/gazebo
RUN apt-get -y install protobuf-compiler
RUN cd /tmp/gazebo && \
hg pull && \
hg update blem_gz6_6.5.1 && \
mkdir build && \
cd build && \
cmake -DKRISLIBRARY_INCLUDE_DIR=/etc/Klampt/Library/KrisLibrary -DKRISLIBRARY_LIBRARY=etc/Klampt/Library/KrisLibrary/lib ../ && \
make -j4 && \
make install
My guess is, that this line (third last):
cmake -DKRISLIBRARY_INCLUDE_DIR=/etc/Klampt/Library/KrisLibrary -DKRISLIBRARY_LIBRARY=etc/Klampt/Library/KrisLibrary/lib ../ && \
is wrong and therefore responsible for the error. I guess i have some dependency which is set wrong. It would be highly appreciated if somebody could help me.
Edit:
The new error, and i updated the Dockerfile and the error Cmake line
Linking CXX shared library libgazebo_physics_ode.so
/usr/bin/ld: cannot find -lKrisLibrary
collect2: error: ld returned 1 exit status
make[2]: *** [gazebo/physics/ode/libgazebo_physics_ode.so.6.5.1] Error 1
gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/build.make:558: recipe for target 'gazebo/physics/ode/libgazebo_physics_ode.so.6.5.1' failed
CMakeFiles/Makefile2:4864: recipe for target 'gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/all' failed
make[1]: *** [gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Related
I'm creating a docker image with OpenBlas, here's a MWV
FROM ubuntu:22.04
# gfortran
RUN apt-get -qq update && apt-get -qq -y install \
build-essential \
gfortran \
curl
# open blas
RUN curl -L https://github.com/xianyi/OpenBLAS/archive/v0.3.7.tar.gz -o v0.3.7.tar.gz \
&& tar -xvf v0.3.7.tar.gz \
&& cd OpenBLAS-0.3.7 \
&& make -j2 USE_THREAD=0 USE_LOCKING=1 DYNAMIC_ARCH=1 NO_AFFINITY=1 FC=gfortran \
&& make install
when I build it I get
#8 14.58 Makefile:139: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail.. Stop.
So far I understand from this post, the idea behind the flags DYNAMIC_ARCH=1 NO_AFFINITY=1 was exactly to avoid optimization for the local architecture. Am I missing something?
Thanks,
I want to install pyproj on Debian on Docker.
This is my script:
FROM debian:latest
RUN /bin/bash -c 'apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-utils && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq \
libpython3-dev \
python3-pip \
proj-bin \
curl \
libcurl4-gnutls-dev \
wget \
sqlite3 \
node-sqlite3 \
libsqlite3-dev \
libtiff5 \
libtiff5-dev \
make \
python-rtree && \
apt-get upgrade -yq && \
apt-get clean && \
apt-get update \
'
RUN wget https://download.osgeo.org/proj/proj-7.2.0.tar.gz
RUN tar -xvzf proj-7.2.0.tar.gz
RUN cd proj-7.2.0/ && ./configure && make && make install
RUN find / -name proj
RUN /bin/bash -c 'rm -rf /var/lib/apt/lists/* && \
pip3 install \
pyproj --no-binary pyproj \
'
This is the output:
Step 6/7 : RUN find / -name proj
---> Running in 6ae2ce5a5157
/usr/share/proj
/usr/local/share/proj
/usr/local/include/proj
/usr/local/bin/proj
/usr/bin/proj
/proj-7.2.0/src/.libs/proj
/proj-7.2.0/src/proj
/proj-7.2.0/include/proj
Removing intermediate container 6ae2ce5a5157
---> 9e652a740f23
Step 7/7 : RUN /bin/bash -c 'rm -rf /var/lib/apt/lists/* && pip3 install pyproj --no-binary pyproj '
---> Running in 2fa15199039b
Collecting pyproj
Downloading https://files.pythonhosted.org/packages/17/e5/3f5cdff3e955bcd768cdb0f4236f2d6e022aaa72f57caf7f4d5f552c88fc/pyproj-3.0.0.post1.tar.gz (663kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-r4rvjbmz/pyproj/setup.py", line 224, in <module>
ext_modules=get_extension_modules(),
File "/tmp/pip-install-r4rvjbmz/pyproj/setup.py", line 155, in get_extension_modules
proj_version = get_proj_version(proj_dir)
File "/tmp/pip-install-r4rvjbmz/pyproj/setup.py", line 22, in get_proj_version
proj_ver = subprocess.check_output(str(proj), stderr=subprocess.STDOUT).decode(
File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '/usr/local/bin/proj' returned non-zero exit status 127.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-r4rvjbmz/pyproj/
Earlier I tried installing pyproj just via pip, it will install PROJ as a dependency, but with the wrong version. That's why I switched to the installation of the binaries via wget.
Also, I gave a find output to show that proj is actually in the right location.
Any suggestions?
https://pyproj4.github.io/pyproj/stable/installation.html
I would recommend either:
Upgrade to pip>=19 so PROJ 7.2 is in the wheel.
ENV PROJ_DIR=/path/to/proj/install and when you install PROJ: ./configure --prefix $PROJ_DIR
I'm trying for facerecogition from (https://github.com/jamct/facerec) on my raspberry pi 3. Therefore the by runs with the newest version of Raspbian Stretch.
I am running:
docker build -t facerec:latest .
But I get the following error:
ERROR: Failed building wheel for scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
Here is a little bit more of the log:
creating build/temp.linux-armv7l-3.6/scipy/fft
creating build/temp.linux-armv7l-3.6/scipy/fft/_pocketfft
compile options: '-DPOCKETFFT_PTHREADS -I/root/.local/include/python3.6m -I/usr/local/include/python3.6m -I/tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/core/include -I/usr/local/include/python3.6m -c'
extra options: '-std=c++14 -fvisibility=hidden'
g++: scipy/fft/_pocketfft/pypocketfft.cxx
Running from scipy source directory.
/tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:572: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:664: UserWarning: Specified path /usr/include/python3.6m is invalid.
return self.get_paths(self.section, key)
scipy/fft/_pocketfft/pypocketfft.cxx:15:31: fatal error: pybind11/pybind11.h: No such file or directory
#include <pybind11/pybind11.h>
^
compilation terminated.
scipy/fft/_pocketfft/pypocketfft.cxx:15:31: fatal error: pybind11/pybind11.h: No such file or directory
#include <pybind11/pybind11.h>
^
compilation terminated.
error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOCKETFFT_PTHREADS -I/root/.local/include/python3.6m -I/usr/local/include/python3.6m -I/tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/core/include -I/usr/local/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-armv7l-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-armv7l-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
The command '/bin/sh -c cd /face_recognition && pip3 install -r requirements.txt && python3 setup.py install' returned a non-zero code: 1
This is the dockerfile:
#Dockerfile for face-recognition
#Based on https://github.com/denverdino/face_recognition_pi
FROM resin/raspberry-pi-python:3
COPY pip.conf /root/.pip/pip.conf
RUN apt-get -y update
RUN apt-get install -y --fix-missing \
build-essential \
cmake \
gfortran \
git \
wget \
curl \
graphicsmagick \
libgraphicsmagick1-dev \
libatlas-dev \
libavcodec-dev \
libavformat-dev \
libboost-all-dev \
libgtk2.0-dev \
libjpeg-dev \
liblapack-dev \
libswscale-dev \
pkg-config \
python3-dev \
zip \
&& apt-get clean && rm -rf /tmp/* /var/tmp/*
RUN python3 -m ensurepip --upgrade && pip3 install --upgrade picamera[array] dlib
RUN pip install --upgrade pip
RUN pip install --upgrade pip setuptools wheel
RUN git clone --single-branch https://github.com/ageitgey/face_recognition.git
RUN cd /face_recognition && \
pip3 install -r requirements.txt && \
python3 setup.py install
CMD cd /face_recognition/examples && \
python3 recognize_faces_in_pictures.py
Would be happy if somebody has an idea what to do now.
Thanks!
You have to install Pybind11 before building SciPy:
python3 -m pip install pybind11
I am relatively new to docker. I have an application which I want to containerize.
Below is is my docker file:
FROM ubuntu:16.04
## ENV Variables
ENV PYTHON_VERSION="3.6.5"
# Update and Install packages
RUN apt-get update -y \
&& apt-get install -y \
curl \
wget \
tar
# Install Python 3.6.5
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz \
&& tar -xvf Python-${PYTHON_VERSION}.tar.xz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure \
&& make altinstall \
&& cd / \
&& rm -rf Python-${PYTHON_VERSION}
# Install Google Cloud SDK
# Downloading gcloud package
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz
# Installing the package
RUN mkdir -p /usr/local/gcloud \
&& tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \
&& /usr/local/gcloud/google-cloud-sdk/install.sh
# Adding the package path to local
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
I am trying to install python3.6.5 version but I am receiving the following error.
020-01-09 17:26:13 (107 KB/s) - 'Python-3.6.5.tar.xz' saved [17049912/17049912]
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
The command '/bin/sh -c wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz && tar -xvf Python-${PYTHON_VERSION}.tar.xz && cd Python-${PYTHON_VERSION} && ./configure && make altinstall && cd / && rm -rf Python-${PYTHON_VERSION}' returned a non-zero code: 2
Decompressing an .xz file requires the xz binary which under ubuntu is provided by the package xz-utils So You have to instal xz-utils on your image prior to decompressing an .xz file.
You can add this to your previous apt-get install run:
# Update and Install packages
RUN apt-get update -y \
&& apt-get install -y \
curl \
wget \
tar \
xz-utils
This should fix the following call to tar in the next RUN expression
Instead of trying to install Python, just start with a base image that has Python preinstalled, e.g. python:3.6-buster. This image is based on Debian Buster, which was released in 2019. Since Ubuntu is based on Debian, everything will be pretty similar, and since it's from 2019 (as opposed to Ubuntu 16.04, which is from 2016) you'll get more up-to-date software.
See https://pythonspeed.com/articles/base-image-python-docker-images/ for longer discussion.
I am trying to create a custom image for building React based project using Alpine as base image.
FROM python:3.6-alpine3.6
ENV NODE_VERSION 8.11.4
RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
autoconf \
automake \
gnupg \
libtool \ # Was added later based on suggestions I saw online
#libltdl-dev \
libgcc \
libc-dev \
libpng-dev \
linux-headers \
make \
python \
# gpg keys listed at https://github.com/nodejs/node#release-team
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
56730D5401028683275BD23C23EFEFE93C4CFFFE \
77984A986EBC2AA786BC0F66B01FBB92821C587A \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
; do \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xf "node-v$NODE_VERSION.tar.xz" \
&& cd "node-v$NODE_VERSION" \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
#&& apk del .build-deps \ # Had to disable this otherwise Node project compilation was failing
&& ln -s /usr/share/aclocal /usr/local/share/aclocal \ # Tried linking but seems it's not working
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
ENV YARN_VERSION 1.6.0
RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& apk del .build-deps-yarn
# RUN Install some more tools in one layer
USER node # Had to use this otherwise Node project compilation was failing when running with root user
Now when i build this image and use in my Bitbucket pipeline, i get the following error:
> node lib/install.js
⚠ spawn /opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor/cjpeg ENOENT
⚠ mozjpeg pre-build test failed
ℹ compiling from source
✖ Error: autoreconf -fiv && ./configure --disable-shared --disable-dependency-tracking --with-jpeg8 --prefix="/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor" --bindir="/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor" --libdir="/opt/atlassian/pipelines/agent/build/node_modules/mozjpeg/vendor" && make -j8 && make install -j8
Command failed: autoreconf -fiv
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:23: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
Checking online gave me clue that libtool was needed so i added that to the Dockerfile (as you can see above) but i am still getting the same error.
Bitbucket pipeline:
image: my_custom_image
pipelines:
branches:
some_branch:
- step:
name: Deploy
script:
- chmod u+x build.sh && bash ./build.sh
I thought of listing the packages that are installed in the image.
$ cat build.sh
#!/bin/bash
apk info -v | sort
ls -laR /usr/share/aclocal
npm install
npm run build
Output of above command:
g++-6.3.0-r4
gcc-6.3.0-r4
gdbm-1.12-r0
git-2.13.7-r0
gmp-6.1.2-r0
gnupg-2.1.20-r1
isl-0.17.1-r0
libassuan-2.4.3-r0
libatomic-6.3.0-r4
libbz2-1.0.6-r5
libc-dev-0.7.1-r0
libc-utils-0.7.1-r0
libcap-2.25-r1
libcurl-7.61.0-r0
libffi-3.2.1-r3
libgcc-6.3.0-r4
libgcrypt-1.7.10-r0
libgomp-6.3.0-r4
libgpg-error-1.27-r0
libksba-1.3.4-r0
libldap-2.4.44-r5
libpng-1.6.29-r1
libpng-dev-1.6.29-r1
libressl2.5-libcrypto-2.5.5-r2
libressl2.5-libssl-2.5.5-r2
libressl2.5-libtls-2.5.5-r2
libsasl-2.1.26-r10
libssh2-1.8.0-r1
libstdc++-6.3.0-r4
linux-headers-4.4.6-r2
m4-1.4.18-r0
make-4.2.1-r0
mpc1-1.0.3-r0
mpfr3-3.1.5-r0
musl-1.1.16-r14
musl-dev-1.1.16-r14
musl-utils-1.1.16-r14
ncurses-libs-6.0_p20171125-r1
ncurses-terminfo-6.0_p20171125-r1
ncurses-terminfo-base-6.0_p20171125-r1
npth-1.2-r0
openssh-7.5_p1-r2
openssh-client-7.5_p1-r2
openssh-keygen-7.5_p1-r2
openssh-server-7.5_p1-r2
openssh-sftp-server-7.5_p1-r2
pcre-8.41-r0
perl-5.24.4-r1
pinentry-1.0.0-r0
pkgconf-1.3.7-r0
python2-2.7.15-r0
readline-6.3.008-r5
scanelf-1.2.2-r0
sqlite-libs-3.20.1-r2
ssl_client-1.26.2-r11
xz-libs-5.2.3-r0
zlib-1.2.11-r0
zlib-dev-1.2.11-r0
/usr/share/aclocal:
total 32
drwxr-xr-x 2 root root 4096 Sep 3 08:37 .
drwxr-xr-x 1 root root 4096 Sep 3 09:04 ..
-rw-r--r-- 1 root root 368 Oct 19 2017 README
-rw-r--r-- 1 root root 12670 May 20 2017 pkg.m4
I could not find libtool in the package list above. Am i missing something?
Note: Using jessie instead of alpine as base image works but the image size is more. I want to keep it as small as possible.
I was finally able to resolve it. Though i came across this link before, that time i just checked the Contents of package section. Today i again visited libtool's page and finally noticed that there is a Depends section on the right-hand side that mentions two packages as dependency (bash and libltdl) for libtool. Installing both the packages did the trick. :)
UPDATE:
Although my issue was resolved, i thought of cleaning up the script just to ensure i don't end up adding unnecessary packages to my image. That's when i found that my earlier assumption about explicitly adding bash and libltdl packages for fixing libtool dependency was wrong. I am going to write all the issues (and fixes) that i encountered while trying to build my docker image for building React project. It's more of a note for me and might still help someone.
Issues and Fixes:
1) npm WARN lifecycle <project_name>#3.6.0~preinstall: cannot run in wd %s %s (wd=%s) <project_name>#3.6.0 npm run npmcheckversion /opt/atlassian/pipelines/agent/build
Fix: Image was running with root user and not with node user. At the end of my Dockerfile, i added this line:
USER node
What this does is runs the image as the specified user and not as root user.
Ref: https://docs.docker.com/v17.09/engine/reference/builder/#user
2) Error: pngquant failed to build, make sure that libpng-dev is installed
Fix: As mentioned in the error message, i installed package libpng-dev
3) /bin/sh: autoreconf: not found
Fix: To fix this, i installed autoconf and libtool. Please note that libtool automatically installs its dependencies i.e., libltdl and bash.
I checked the list of installed packages and was able to confirm that libtool was actually installed but the build again failed, although with another error.
4) Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
Fix: automake was required to fix the issue. Still, one more error was about to come :)
5) configure: error: no nasm (Netwide Assembler) found
Fix: Installing nasm package fixed it.
That's it. I was ready with my final image. ;)