Compiling gcc 12.2.0 on dockerized Centos 7 fail with "execvp: Permission denied" - docker

Due to some constraints, I have to compile the latest version of gcc in a dockerized centos7, here is the testing Dockerfile :
FROM centos:7 as deps
ENV INSTALL_PREFIX /opt/deps
ENV PROC -j4
ENV LD_LIBRARY_PATH $INSTALL_PREFIX/lib:$LD_LIBRARY_PATH
ENV PATH $INSTALL_PREFIX/bin:$PATH
WORKDIR /root
RUN yum -y -q install deltarpm && yum -y -q update && yum -y -q groupinstall 'Development Tools'
COPY packages/common/ .
RUN tar -xzf lzip-1.23.tar.gz && cd lzip-1.23 && ./configure && make $PROC && make install
RUN tar -xzf binutils-2.35.2.tar.gz && cd binutils-2.35.2 && ./configure --prefix=$INSTALL_PREFIX && make $PROC && make install
RUN tar --lzip -xf gmp-6.2.1.tar.lz && cd gmp-6.2.1 && ./configure --prefix=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf mpfr-4.2.0.tar.gz && cd mpfr-4.2.0 && ./configure --prefix=$INSTALL_PREFIX --with-gmp=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf mpc-1.3.1.tar.gz && cd mpc-1.3.1 && ./configure --prefix=$INSTALL_PREFIX --with-mpfr=$INSTALL_PREFIX --with-gmp=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf zstd-1.5.4.tar.gz && cd zstd-1.5.4 && make $PROC && make DESTDIR=$INSTALL_PREFIX install && cp -R $INSTALL_PREFIX/usr/local/* $INSTALL_PREFIX/. && rm -rf $INSTALL_PREFIX/usr
RUN tar -xzf isl-0.25.tar.gz && cd isl-0.25 && ./configure --prefix=$INSTALL_PREFIX --with-gmp-prefix=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf gcc-12.2.0.tar.gz && mkdir $INSTALL_PREFIX/../gcc
WORKDIR /tmp/gcc
RUN ~/gcc-12.2.0/configure --prefix=$INSTALL_PREFIX/../gcc --with-ld=$INSTALL_PREFIX/bin --enable-languages=c,c++ --disable-multilib --with-mpfr=$INSTALL_PREFIX --with-gmp=$INSTALL_PREFIX \
--with-mpc=$INSTALL_PREFIX --with-isl=$INSTALL_PREFIX --with-zstd=$INSTALL_PREFIX
RUN make $PROC || true
#RUN make install
ENTRYPOINT ["/bin/bash"]
This is the error I get when I try to compile gcc version 12.2.0 :
[ -f stage_final ] || echo stage3 > stage_final
make[1]: Entering directory `/tmp/gcc'
make[2]: Entering directory `/tmp/gcc'
make[3]: Entering directory `/tmp/gcc'
rm -f stage_current
make[3]: Leaving directory `/tmp/gcc'
make[2]: Leaving directory `/tmp/gcc'
make[2]: Entering directory `/tmp/gcc'
make[3]: Entering directory `/tmp/gcc/libiberty'
make[4]: Entering directory `/tmp/gcc/libiberty/testsuite'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/tmp/gcc/libiberty/testsuite'
make[3]: Leaving directory `/tmp/gcc/libiberty'
make[3]: Entering directory `/tmp/gcc/lto-plugin'
make all-am
make[4]: Entering directory `/tmp/gcc/lto-plugin'
make[4]: Leaving directory `/tmp/gcc/lto-plugin'
make[3]: Leaving directory `/tmp/gcc/lto-plugin'
make[3]: Entering directory `/tmp/gcc/intl'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/intl'
make[3]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty'
make[4]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[3]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty'
make[3]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/fixincludes'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/fixincludes'
make[3]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[3]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libcpp'
make[3]: Entering directory `/tmp/gcc/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc -std=gnu99" "CFLAGS=-g" "CXXFLAGS=-g" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c$make[3]: Leaving directory `/tmp/gcc/zlib'
make[3]: Entering directory `/tmp/gcc/libbacktrace'
make all-am
make[4]: Entering directory `/tmp/gcc/libbacktrace'
true DO=all multi-do # make
make[4]: Leaving directory `/tmp/gcc/libbacktrace'
make[3]: Leaving directory `/tmp/gcc/libbacktrace'
make[3]: Entering directory `/tmp/gcc/libcpp'
make[3]: Leaving directory `/tmp/gcc/libcpp'
make[3]: Entering directory `/tmp/gcc/libcody'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/libcody'
make[3]: Entering directory `/tmp/gcc/libdecnumber'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/libdecnumber'
make[3]: Entering directory `/tmp/gcc/gcc'
make[3]: Leaving directory `/tmp/gcc/gcc'
Checking multilib configuration for libgcc...
make[3]: Entering directory `/tmp/gcc/x86_64-pc-linux-gnu/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
# Early copyback; see "all" above for the rationale. The
# early copy is necessary so that the gcc -B options find
# the right startup files when linking shared libgcc.
/bin/sh /root/gcc-12.2.0/libgcc/../mkinstalldirs ../.././gcc
parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"; \
for file in $parts; do \
rm -f ../.././gcc/$file; \
/usr/bin/install -c -m 644 $file ../.././gcc/; \
case $file in \
*.a) \
ranlib ../.././gcc/$file ;; \
esac; \
done
# #multilib_flags# is still needed because this may use
# /tmp/gcc/./gcc/xgcc -B/tmp/gcc/./gcc/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/bin/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/include -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/sys-incl$# #multilib_dir# is not really necessary, but sometimes it has
# more uses than just a directory name.
/bin/sh /root/gcc-12.2.0/libgcc/../mkinstalldirs .
/tmp/gcc/./gcc/xgcc -B/tmp/gcc/./gcc/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/bin/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/include -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/sys-includ$collect2: fatal error: execvp: Permission denied
compilation terminated.
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/tmp/gcc/x86_64-pc-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/tmp/gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc'
make: *** [all] Error 2
I get the same kind of error with gcc 10 and 9. I am using docker on windows version 4.16.3(96739).
I fail to understand what is called with execvp, and since I am root, how I am getting Permission denied. I should be able to successfully able to completely compile gcc. How to do ?
67527678, 67090507 do not work (and I am not able to use 67090507)
EDIT : I forgot to precise that chmod or chown do not solve the issue.

Related

Error installing idb iOS pen testing tool on Mac

Fetching libxml-ruby-3.1.0.gem
Fetching mini_portile2-2.4.0.gem
Fetching nokogiri-1.10.10.gem
Building native extensions. This could take a while...
Successfully installed sqlite3-1.4.2
Building native extensions. This could take a while...
ERROR: Error installing idb:
ERROR: Failed to build gem native extension.
current directory: /Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.5
/Users/dhruvbaviskar/.rvm/rubies/ruby-2.4.1/bin/ruby -I /Users/dhruvbaviskar/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0 -r ./siteconf20210417-63256-bumwrc.rb extconf.rb
current directory: /Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.5
make DESTDIR\= clean
mkdir ext/build
mkdir bin/2.4
mkdir bin/plugins
mkdir bin/plugins/accessible
mkdir bin/plugins/bearer
mkdir bin/plugins/codecs
mkdir bin/plugins/designer
mkdir bin/plugins/graphicssystems
mkdir bin/plugins/iconengines
mkdir bin/plugins/imageformats
mkdir bin/plugins/phonon_backend
mkdir bin/plugins/qmltooling
mkdir bin/plugins/sqldrivers
mkdir lib/2.4
cd ext/build; rm -rf CMakeFiles
cd ext/build; rm -rf generator
cd ext/build; rm -rf smoke
cd ext/build; rm -rf ruby
cd ext/build; rm *
rm: *: No such file or directory
make: [clean] Error 1 (ignored)
current directory: /Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.5
make DESTDIR\=
mkdir ext/build
mkdir: ext/build: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/2.4
mkdir: bin/2.4: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins
mkdir: bin/plugins: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/accessible
mkdir: bin/plugins/accessible: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/bearer
mkdir: bin/plugins/bearer: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/codecs
mkdir: bin/plugins/codecs: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/designer
mkdir: bin/plugins/designer: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/graphicssystems
mkdir: bin/plugins/graphicssystems: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/iconengines
mkdir: bin/plugins/iconengines: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/imageformats
mkdir: bin/plugins/imageformats: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/phonon_backend
mkdir: bin/plugins/phonon_backend: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/qmltooling
mkdir: bin/plugins/qmltooling: File exists
make: [makedirs] Error 1 (ignored)
mkdir bin/plugins/sqldrivers
mkdir: bin/plugins/sqldrivers: File exists
make: [makedirs] Error 1 (ignored)
mkdir lib/2.4
mkdir: lib/2.4: File exists
make: [makedirs] Error 1 (ignored)
cd ext/build; rm -rf CMakeFiles
cd ext/build; rm -rf generator
cd ext/build; rm -rf smoke
cd ext/build; rm -rf ruby
cd ext/build; rm *
rm: *: No such file or directory
make: [clean] Error 1 (ignored)
cd ext/build; \
cmake -DCMAKE_MINIMUM_REQUIRED_VERSION=2.6 \
-G "Unix Makefiles" \
-Wno-dev \
-DRUBY_EXECUTABLE=/Users/dhruvbaviskar/.rvm/rubies/ruby-2.4.1/bin/ruby \
..
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FindQt4.cmake:1314 (message):
Found unsuitable Qt version "6.0.3" from /usr/local/bin/qmake, this code
requires Qt 4.x
Call Stack (most recent call first):
generator/CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
See also "/Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.5/ext/build/CMakeFiles/CMakeOutput.log".
See also "/Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.5/ext/build/CMakeFiles/CMakeError.log".
make: [build] Error 1 (ignored)
cd ext/build; make
make[1]: *** No targets specified and no makefile found. Stop.
make: *** [build] Error 2
make failed, exit code 2
Gem files will remain installed in /Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.5 for inspection.
Results logged to /Users/dhruvbaviskar/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-20/2.4.0/qtbindings-4.8.6.5/gem_make.out
The important part of the error message is:
Found unsuitable Qt version "6.0.3" from /usr/local/bin/qmake, this code requires Qt 4.x
You appear to have QT 6.0.3 installed (potentially via Homebrew). The qtbindings gem you are trying to install there (likely as a transient dependency) requires QT 4 however.
With homebrew, you could install it with
brew tap cartr/qt4
brew install qt#4

Building Fiware Orion context broker on LinuxOne docker (s390x)

I am trying to build Fiware Orion context broker using Dockerfile at:
https://hub.docker.com/r/fiware/orion/
As a first step I have tried replacing the FROM image with the "supposed" equivalent of Centos for s390x, ClefOS: https://hub.docker.com/_/clefos :
FROM s390x/clefos:7.6.1810
It takes a long time and seems to go OK but ends up with the error below. Any ideas? Anybody has successfully built any Orion version docker image on IBM Z? (s390x)
Update: I have added those four libraries in the yum install command in Dockerfile and they are correctly installed but the problem is still there. It seems not just a problem of those boost_* libs missing but some configuration fix needed to "ld" locates them.
[ 97%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoRegistrationCreate.cpp.o
[ 97%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoRegistrationDelete.cpp.o
[ 97%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/connectionOperations.cpp.o
[ 97%] [ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoSubCache.cpp.o
Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/safeMongo.cpp.o
[ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/compoundResponses.cpp.o
[ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/location.cpp.o
[ 99%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/compoundValueBson.cpp.o
[ 99%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/dateExpiration.cpp.o
Linking CXX static library libmongoBackend.a
make[3]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
[ 99%] Built target mongoBackend
make[3]: Entering directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
Scanning dependencies of target contextBroker
make[3]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make[3]: Entering directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
[100%] Building CXX object src/app/contextBroker/CMakeFiles/contextBroker.dir/contextBroker.cpp.o
[100%] Building CXX object src/app/contextBroker/CMakeFiles/contextBroker.dir/orionRestServices.cpp.o
Linking CXX executable contextBroker
/usr/bin/ld: cannot find -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_filesystem-mt
/usr/bin/ld: cannot find -lboost_system-mt
/usr/bin/ld: cannot find -lboost_regex-mt
collect2: error: ld returned 1 exit status
make[3]: *** [src/app/contextBroker/contextBroker] Error 1
make[3]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make[2]: *** [src/app/contextBroker/CMakeFiles/contextBroker.dir/all] Error 2
make[2]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make: *** [release] Error 2
The command '/bin/sh -c adduser --comment "${ORION_USER}" ${ORION_USER} && yum -y install epel-release && yum -y install boost-devel bzip2 cmake gnutls-devel libgcrypt-devel libcurl-devel openssl-devel libuuid-devel make nc git gcc-c++ scons tar which cyrus-sasl-devel && curl -kOL http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.48.tar.gz && tar xvf libmicrohttpd-0.9.48.tar.gz && cd libmicrohttpd-0.9.48 && ./configure --disable-messages --disable-postprocessor --disable-dauth && make && make install && ldconfig && curl -kOL https://github.com/mongodb/mongo-cxx-driver/archive/legacy-1.1.2.tar.gz && tar xfz legacy-1.1.2.tar.gz && cd mongo-cxx-driver-legacy-1.1.2 && scons --use-sasl-client --ssl && scons install --prefix=/usr/local --use-sasl-client --ssl && curl -kOL https://github.com/miloyip/rapidjson/archive/v1.0.2.tar.gz && tar xfz v1.0.2.tar.gz && mv rapidjson-1.0.2/include/rapidjson/ /usr/local/include && git clone https://github.com/telefonicaid/fiware-orion && cd fiware-orion && git checkout ${GIT_REV_ORION} && make && make install && strip /usr/bin/contextBroker && mkdir -p /var/log/contextBroker && mkdir -p /var/run/contextBroker && chown ${ORION_USER} /var/log/contextBroker && chown ${ORION_USER} /var/run/contextBroker && cd /opt && if [ ${CLEAN_DEV_TOOLS} -eq 0 ] ; then yum clean all && exit 0 ; fi && rm -rf /opt/libmicrohttpd-0.9.48.tar.gz /usr/local/include/microhttpd.h /usr/local/lib/libmicrohttpd.* /opt/libmicrohttpd-0.9.48 /opt/legacy-1.1.2.tar.gz /opt/mongo-cxx-driver-legacy-1.1.2 /usr/local/include/mongo /usr/local/lib/libmongoclient.a /opt/rapidjson-1.0.2 /opt/v1.0.2.tar.gz /usr/local/include/rapidjson /opt/fiware-orion /usr/share/cracklib /usr/share/i18n /usr/{lib,lib64}/gconv && yum -y erase git perl* rsync cmake libarchive gcc-c++ cloog-ppl cpp gcc glibc-devel glibc-headers kernel-headers libgomp libstdc++-devel mpfr ppl scons boost-devel libcurl-devel gnutls-devel libgcrypt-devel clang llvm llvm-libs CUnit-devel CUnit autoconf automake m4 libidn-devel boost-wave boost-serialization boost-python boost-iostreams boost boost-date-time boost-test boost-graph boost-signals boost-program-options boost-math openssh openssh-clients libedit hwdata dbus-glib fipscheck* *devel sysvinit-tools && rpm -qa groff | xargs -r rpm -e --nodeps && yum clean all && rm -rf /var/lib/yum/yumdb && rm -rf /var/lib/yum/history && rpm -vv --rebuilddb && find /usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en_US' ! -name 'locale.alias' | xargs -r rm -r && bash -c 'localedef --list-archive | grep -v -e "en_US" | xargs localedef --delete-from-archive' && /bin/cp -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl && build-locale-archive && rm -f /var/log/*log' returned a non-zero code: 2
By
/usr/bin/ld: cannot find -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_filesystem-mt
/usr/bin/ld: cannot find -lboost_system-mt
/usr/bin/ld: cannot find -lboost_regex-mt
I guess some required dependencies are missing. The solution would be to install them as part of the Dockefile script. However, not sure how to do it in s390x/clefos (in CentOS is a matter of installing the package that contains the dependency using yum, the Dockerfile does that).

Docker Build SofteWare using Alphine Linux with Error 'install: unrecognized option: strip-program=strip'

I'm building a mosquito docker image, when calling make install meet these error messages 'install: unrecognized option: strip-program=strip', please help, thanks.
install -d /usr/local/lib/
install -s --strip-program=strip libmosquitto.so.1
/usr/local/lib/libmosquitto.so.1
install: unrecognized option: strip-program=strip
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.
Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST
Copy files and set attributes
-c Just copy (default)
-d Create directories
-D Create leading target directories
-s Strip symbol table
-p Preserve date
-o USER Set ownership
-g GRP Set group ownership
-m MODE Set permissions
-t DIR Install to DIR
make[1]: *** [Makefile:28: install] Error 1
make[1]: Leaving directory '/usr/local/src/mosquitto-1.4.15/lib'
make: *** [Makefile:38: install] Error 2
Part of My Dockfile:
FROM alpine:3.7
RUN apk add --update --no-cache build-base openssl openssl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt && \
cd /usr/local && \
mkdir src && \
cd src && \
wget https://mosquitto.org/files/source/mosquitto-1.4.15.tar.gz && \
tar -zxvf mosquitto-1.4.15.tar.gz && \
cd mosquitto-1.4.15 && \
make && make install
Call make the last several result lines:
cc -Wall -ggdb -O2 -c mosquitto_passwd.c -o mosquitto_passwd.o
cc mosquitto_passwd.o -o mosquitto_passwd -lcrypto
make[1]: Leaving directory '/usr/local/src/mosquitto-1.4.15/src'
set -e; for d in man; do make -C ${d}; done
make[1]: Entering directory '/usr/local/src/mosquitto-1.4.15/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/usr/local/src/mosquitto-1.4.15/man'
The problem is that you're installing a mosquitto tar.gz with /usr/bin/install version: BusyBox v1.27.2, and your mosquitto's tar.gz downloaded with wget needs /usr/bin/install version from GNU coreutils 8.25 for example, which includes your missing option strip-program.
So, solution is simple: install a mosquitto version for alpine, not for generic Linux:
FROM alpine:3.7
RUN apk add --update --no-cache build-base openssl openssl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt && \
apk add mosquitto
It'll install version 1.4.15.
EDIT: If you need to install a plugin and compile a generic linux tar.gz, you have to install apk add coreutils
Except for the answer #mulg0r gave me. I found there was another way to solve this. I think this is also useful when someone meets a similar problem. From https://git.alpinelinux.org/cgit/aports/tree/main/mosquitto?h=master this link. the package from alpine Linux. Click the Git repository button, inside that page, this package's build process instructions are there. And some code changes to suit alpine Linux.
For this question, find APKBUILD file from https://git.alpinelinux.org/cgit/aports/tree/main/mosquitto?h=master. this line also solved my question:
sed -i -e "s|(INSTALL) -s|(INSTALL)|g" \
-e 's|--strip-program=${CROSS_COMPILE}${STRIP}||' \
*/Makefile */*/Makefile
Above is just comment out --strip-program when excute make install

Error cannot find -lz building MariaDB on a debian based container

I'm trying to build MariaDB on a Debian based container. But it cannot find a z library.
Here is the container image script:
FROM debian
RUN apt-get update
RUN apt-get install -y libncurses-dev
RUN apt-get install -y build-essential;
RUN apt-get install -y cmake;
COPY mariadb-10.1.18.tar.gz /usr/bin/
WORKDIR /usr/bin/
RUN gzip -d mariadb-10.1.18.tar.gz
RUN tar -xvf mariadb-10.1.18.tar
RUN ln -s mariadb-10.1.18 mariadb
WORKDIR /usr/bin/mariadb/
RUN mkdir install; mkdir install/data; mkdir install/var; mkdir install/etc; mkdir install/tmp
RUN cd /usr/bin/mariadb/;
RUN rm -f CMakeCache.txt;
RUN cmake \
-DCMAKE_INSTALL_PREFIX=/usr/bin/mariadb/install \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/usr/bin/mariadb/install/data \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/bin/mariadb/install/boost \
-DMYSQL_UNIX_ADDR=/usr/bin/mariadb/install/tmp/mariadb.sock
And the console output:
[ 77%] Building CXX object storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/log_print.cc.o
Linking CXX shared library libft.so
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/build.make:1323: recipe for target 'storage/tokudb/PerconaFT/ft/libft.so' failed
make[2]: *** [storage/tokudb/PerconaFT/ft/libft.so] Error 1
CMakeFiles/Makefile2:3438: recipe for target 'storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/all' failed
make[1]: *** [storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c make' returned a non-zero code: 2
either change the container script and specify CMake parameter -DWITH_ZLIB=bundled to use zlib sources in extra/zlib or install zlib by apt-get install zlib-devel

make[1]: [install-domserver-l] Error 1 (ignored)

I've been trying to install domjudge on a docker container, but when I execute
sudo make install-domserver
I keep getting this error:
/usr/bin/install -c -m 0644 -o -m 0700 -d /home/domjudge/domjudge/domserver/log
/usr/bin/install: invalid user '-m'
Makefile:98: recipe for target 'install-domserver-l' failed
You may see the full log here:
docker run -it -p 8080:80 a596a9e71faf
domjudge#f31ab58ea764:~/domjudge-5.0.1$ ./configure --prefix=$HOME/domjudge
checking whether configure should try to set CFLAGS... yes
checking whether configure should try to set CXXFLAGS... yes
checking whether configure should try to set LDFLAGS... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether C compiler accepts -Wall... yes
checking whether C compiler accepts -fstack-protector... yes
checking whether C compiler accepts -fPIE... yes
checking whether C compiler accepts -D_FORTIFY_SOURCE=2... yes
checking whether the linker accepts -fPIE... yes
checking whether the linker accepts -pie... yes
checking whether the linker accepts -Wl,-z,relro... yes
checking whether the linker accepts -Wl,-z,now... yes
checking domjudge-user... (default: current user)
checking webserver-group... www-data (detected)
checking runuser... domjudge-run (default)
checking for cgroup_init in -lcgroup... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C++ preprocessor... g++ -E
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtol... yes
configure: creating ./config.status
config.status: creating paths.mk
config.status: creating etc/config.h
Summary:
* project.............: DOMjudge 5.0.1
* prefix..............: /home/domjudge/domjudge
* CPPFLAGS............:
* CFLAGS..............: -g -O2 -Wall -fstack-protector -fPIE -D_FORTIFY_SOURCE=2
* CXXFLAGS............: -g -O2 -Wall -fstack-protector -fPIE -D_FORTIFY_SOURCE=2
* LDFLAGS.............: -fPIE -pie -Wl,-z,relro -Wl,-z,now
* default user........:
* runguard user.......: domjudge-run
* webserver group.....: www-data
* use Linux cgroups...: no
* submitclient........: enabled, cURL version: 7.38.0
* documentation.......: /home/domjudge/domjudge/doc
* domserver...........: /home/domjudge/domjudge/domserver
- bin..............: /home/domjudge/domjudge/domserver/bin
- etc..............: /home/domjudge/domjudge/domserver/etc
- lib..............: /home/domjudge/domjudge/domserver/lib
- libext...........: /home/domjudge/domjudge/domserver/lib/ext
- libwww...........: /home/domjudge/domjudge/domserver/lib/www
- libsubmit........: /home/domjudge/domjudge/domserver/lib/submit
- log..............: /home/domjudge/domjudge/domserver/log
- run..............: /home/domjudge/domjudge/domserver/run
- sql..............: /home/domjudge/domjudge/domserver/sql
- submit...........: /home/domjudge/domjudge/domserver/submissions
- tmp..............: /home/domjudge/domjudge/domserver/tmp
- www..............: /home/domjudge/domjudge/domserver/www
* judgehost...........: /home/domjudge/domjudge/judgehost
- bin..............: /home/domjudge/domjudge/judgehost/bin
- etc..............: /home/domjudge/domjudge/judgehost/etc
- lib..............: /home/domjudge/domjudge/judgehost/lib
- libext...........: /home/domjudge/domjudge/judgehost/lib/ext
- libjudge.........: /home/domjudge/domjudge/judgehost/lib/judge
- log..............: /home/domjudge/domjudge/judgehost/log
- run..............: /home/domjudge/domjudge/judgehost/run
- tmp..............: /home/domjudge/domjudge/judgehost/tmp
- judge............: /home/domjudge/domjudge/judgehost/judgings
- chroot...........: /chroot/domjudge
- cgroup...........: /cgroup
Run 'make' without arguments to get a list of (build) targets.
domjudge#f31ab58ea764:~/domjudge-5.0.1$ make domserver
make -C etc config
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/etc'
Substituting configure variables in 'apache.conf'.
Substituting configure variables in 'nginx-conf'.
Substituting configure variables in 'domserver-static.php'.
Substituting configure variables in 'judgehost-static.php'.
Substituting configure variables in 'runguard-config.h'.
Substituting configure variables in 'submit-config.h'.
Substituting configure variables in 'sudoers-domjudge'.
Substituting configure variables in 'cgroup-domjudge.conf'.
Substituting configure variables in 'domjudge-judgehost.init'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/etc'
Recursing target `domserver' into: etc sql www misc-tools
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/etc'
echo "# Randomly generated on host `hostname`, `date`" > dbpasswords.secret
chmod go= dbpasswords.secret
./gendbpasswords >> dbpasswords.secret
echo "# Randomly generated on host `hostname`, `date`" > restapi.secret
chmod go= restapi.secret
./genrestapicredentials >> restapi.secret
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/etc'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/sql'
Substituting configure variables in 'dj-setup-database'.
chmod a+x dj-setup-database
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/sql'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/www'
Substituting configure variables in 'configure.php'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/www'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/misc-tools'
Substituting configure variables in 'balloons'.
chmod a+x balloons
Substituting configure variables in 'create_accounts'.
chmod a+x create_accounts
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/misc-tools'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1'
make[1]: Nothing to be done for 'domserver-l'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1'
domjudge#f31ab58ea764:~/domjudge-5.0.1$ sudo make install-domserver
make -C etc config
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/etc'
make[1]: Nothing to be done for 'config'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/etc'
Recursing target `domserver' into: etc sql www misc-tools
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/etc'
make[1]: Nothing to be done for 'domserver'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/etc'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/sql'
make[1]: Nothing to be done for 'domserver'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/sql'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/www'
make[1]: Nothing to be done for 'domserver'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/www'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/misc-tools'
make[1]: Nothing to be done for 'domserver'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/misc-tools'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1'
make[1]: Nothing to be done for 'domserver-l'.
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1'
/usr/bin/install -c -d /home/domjudge/domjudge/domserver/bin /home/domjudge/domjudge/domserver/etc /home/domjudge/domjudge/domserver/www /home/domjudge/domjudge/domserver/lib /home/domjudge/domjudge/domserver/lib/submit /home/domjudge/domjudge/domserver/lib/ext /home/domjudge/domjudge/domserver/lib/www /home/domjudge/domjudge/domserver/log /home/domjudge/domjudge/domserver/run /home/domjudge/domjudge/domserver/tmp /home/domjudge/domjudge/domserver/submissions /home/domjudge/domjudge/domserver/sql/upgrade /home/domjudge/domjudge/domserver/www/images/affiliations /home/domjudge/domjudge/domserver/www/images/countries /home/domjudge/domjudge/domserver/www/images/teams /home/domjudge/domjudge/domserver/www/public /home/domjudge/domjudge/domserver/www/team /home/domjudge/domjudge/domserver/www/jury /home/domjudge/domjudge/domserver/www/api /home/domjudge/domjudge/domserver/www/auth /home/domjudge/domjudge/domserver/www/js /home/domjudge/domjudge/domserver/www/js/flot /home/domjudge/domjudge/domserver/www/js/ace
Recursing target `install-domserver' into: etc lib sql www misc-tools
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/etc'
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/etc \
apache.conf nginx-conf domserver-static.php
/usr/bin/install -c -t /home/domjudge/domjudge/domserver/etc \
gendbpasswords genrestapicredentials
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/etc \
domserver-config.php common-config.php
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/etc'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/lib'
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/lib *.php
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/lib/www www/*.php
/usr/bin/install -c -t /home/domjudge/domjudge/domserver/lib alert
cp -R -t /home/domjudge/domjudge/domserver/lib/ext ext/*
chmod -R a+rX /home/domjudge/domjudge/domserver/lib/ext
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/lib'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/sql'
/usr/bin/install -c -t /home/domjudge/domjudge/domserver/bin dj-setup-database
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/sql \
mysql_db_structure.sql mysql_db_defaultdata.sql mysql_db_examples.sql \
mysql_db_files_defaultdata.sql mysql_db_files_examples.sql
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/sql/upgrade \
upgrade/upgrade_*.sql upgrade/README
/usr/bin/install -c -d /home/domjudge/domjudge/domserver/sql/files/defaultdata /home/domjudge/domjudge/domserver/sql/files/examples
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/sql/files/defaultdata \
files/defaultdata/*.zip
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/sql/files/examples \
files/examples/*.zip
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/sql'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/www'
for d in . countries ; do \
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/images/$d images/$d/*.png ; \
done
for d in public team jury api auth ; do \
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/$d $d/*.php ; \
done
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/images/teams images/teams/*.jpg
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/jury jury/*.css
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/js js/*.js js/*.gif js/*.png
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/js/flot js/flot/*.js
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www/js/ace js/ace/*.js
/usr/bin/install -c -m 0644 -t /home/domjudge/domjudge/domserver/www *.php *.css
rm -f /home/domjudge/domjudge/domserver/www/jury/doc
ln -s /home/domjudge/domjudge/doc /home/domjudge/domjudge/domserver/www/jury/doc
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/www'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1/misc-tools'
/usr/bin/install -c -t /home/domjudge/domjudge/domserver/bin balloons create_accounts
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1/misc-tools'
make[1]: Entering directory '/home/domjudge/domjudge-5.0.1'
make check-root
make[2]: Entering directory '/home/domjudge/domjudge-5.0.1'
make[2]: Leaving directory '/home/domjudge/domjudge-5.0.1'
/usr/bin/install -c -m 0644 -o -m 0700 -d /home/domjudge/domjudge/domserver/log
/usr/bin/install: invalid user '-m'
Makefile:98: recipe for target 'install-domserver-l' failed
make[1]: [install-domserver-l] Error 1 (ignored)
/usr/bin/install -c -m 0644 -o -m 0700 -d /home/domjudge/domjudge/domserver/run
/usr/bin/install: invalid user '-m'
Makefile:98: recipe for target 'install-domserver-l' failed
make[1]: [install-domserver-l] Error 1 (ignored)
/usr/bin/install -c -m 0644 -o -g www-data -m 0770 -d /home/domjudge/domjudge/domserver/submissions
/usr/bin/install: invalid user '-g'
Makefile:98: recipe for target 'install-domserver-l' failed
make[1]: [install-domserver-l] Error 1 (ignored)
/usr/bin/install -c -m 0644 -o -g www-data -m 0770 -d /home/domjudge/domjudge/domserver/tmp
/usr/bin/install: invalid user '-g'
Makefile:98: recipe for target 'install-domserver-l' failed
make[1]: [install-domserver-l] Error 1 (ignored)
/usr/bin/install -c -m 0644 -o -m 0600 -t /home/domjudge/domjudge/domserver/etc \
etc/restapi.secret
/usr/bin/install: invalid user '-m'
Makefile:98: recipe for target 'install-domserver-l' failed
make[1]: [install-domserver-l] Error 1 (ignored)
/usr/bin/install -c -m 0644 -o -g www-data -m 0640 -t /home/domjudge/domjudge/domserver/etc \
etc/dbpasswords.secret
/usr/bin/install: invalid user '-g'
Makefile:98: recipe for target 'install-domserver-l' failed
make[1]: [install-domserver-l] Error 1 (ignored)
make[1]: Leaving directory '/home/domjudge/domjudge-5.0.1'
domjudge#f31ab58ea764:~/domjudge-5.0.1$
I was missing using the --with-domjudge-user arg in ./configure --prefix=$HOME/domjudge --with-domjudge-user=domjudge .
Thanks again to Etan Reisner for its feedback.

Resources