docker: alpine release image add libgit2, tcl, configure to work without sudo
@@ -6,14 +6,13 @@ RUN apk update \
build-base \
cmake \
curl \
- diffutils \
- file \
+ libgit2 \
git \
ninja \
- ronn \
+ tcl \
yaml-cpp-dev
-# Google Test
+# Google Test (TODO: update before 0.9.2 to gtest 1.10.0, but does not work with elektra 0.9.1)
ENV GTEST_ROOT=/opt/gtest
ARG GTEST_VER=release-1.8.1
RUN mkdir -p ${GTEST_ROOT} \
@@ -32,6 +31,12 @@ RUN mkdir -p ${ELEKTRA_ROOT} \
&& tar -zxvf elektra.tar.gz --strip-components=1 -C ${ELEKTRA_ROOT} \
&& rm elektra.tar.gz
+ARG USERID=1000
+RUN adduser \
+ -u ${USERID} \
+ -D \
+ elektra
+
ARG PARALLEL=8
WORKDIR ${ELEKTRA_ROOT}
RUN mkdir build \
@@ -40,19 +45,18 @@ RUN mkdir build \
-DTOOLS="ALL" \
-DENABLE_DEBUG="OFF" \
-DENABLE_LOGGER="OFF" \
+ -DKDB_DB_SYSTEM='/home/elektra/.config/kdb/system' \
+ -DKDB_DB_SPEC='/home/elektra/.config/kdb/spec' \
+ -DKDB_DB_HOME='/home/elektra/.config/kdb/home' \
.. \
&& make -j ${PARALLEL} \
- && ctest -T Test --output-on-failure -j ${PARALLEL} -LE kdbtests
+ && ctest -T Test --output-on-failure -j ${PARALLEL}
FROM alpine:3.10
COPY --from=0 ${ELEKTRA_ROOT} \
${ELEKTRA_ROOT}
-RUN apk update \
- && apk add --no-cache --upgrade\
- bash
-
ENV ELEKTRA_ROOT=/opt/elektra
WORKDIR ${ELEKTRA_ROOT}
RUN cd build \
@@ -60,16 +64,11 @@ RUN cd build \
&& ldconfig /usr/local/lib/elektra/ \
&& rm -Rf ${ELEKTRA_ROOT}
+RUN echo "alias sudo='' # in this image we do not need to be root" >> /etc/profile
+RUN echo "export PS1='\u $ '" >> /etc/profile
ENV LD_LIBRARY_PATH=/usr/local/lib/elektra/
+ENV ENV="/etc/profile"
-# Create User:Group
-# The id is important as jenkins docker agents use the same id that is running
-# on the slaves to execute containers
ARG USERID=1000
-RUN adduser \
- -u ${USERID} \
- -D \
- -s /bin/bash \
- elektra
USER ${USERID}
WORKDIR /home/elektra
