1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
# Keyman is copyright (C) SIL Global. MIT License.
ARG BASE_VERSION=default
FROM keymanapp/keyman-base-ci:${BASE_VERSION}
LABEL org.opencontainers.image.authors="SIL Global."
LABEL org.opencontainers.image.url="https://github.com/keymanapp/keyman.git"
LABEL org.opencontainers.image.title="Keyman Linux Build Image"
# Install dependencies
ADD control /tmp/control
# Answer 'yes' to install questions
RUN apt-get update && \
apt-get install -qy python3 python3-setuptools python3-coverage \
devscripts equivs libdatetime-perl lcov gcovr xvfb \
xserver-xephyr metacity mutter dbus-x11 weston xwayland && \
(yes | mk-build-deps --install /tmp/control) || true && \
rm /tmp/control
# Install lcov for code coverage
# Update to the latest and install packages needed for Linux coverage reporting
# and integration tests. We need at least version 2.0 of lcov. However,
# version 2.0-4 from Noble doesn't work either on Jammy. So we use
# version 2.0-1 from Mantic.
RUN LCOV_VERSION=$(dpkg -s lcov | grep Version | cut -d' ' -f2) && \
if dpkg --compare-versions "${LCOV_VERSION}" lt 2.0; then \
curl -sS -o /tmp/lcov.deb --location https://old-releases.ubuntu.com/ubuntu/pool/universe/l/lcov/lcov_2.0-1ubuntu0.2_all.deb && \
apt-get -qy install /tmp/lcov.deb && \
rm /tmp/lcov.deb ; \
fi
RUN mkdir -p /run/user/1000 && \
chown build:build /run/user/1000 && \
chmod 700 /run/user/1000 && \
mkdir -p /tmp/.X11-unix && \
chmod 1777 /tmp/.X11-unix && \
echo "export XDG_RUNTIME_DIR=/run/user/1000" >> /usr/bin/bashwrapper
COPY run-tests.sh /usr/bin/run-tests.sh
# Finish bashwrapper script and adjust permissions
RUN <<EOF cat >> /usr/bin/bashwrapper
if [[ "\$@" =~ test ]] && [ -f /usr/bin/run-tests.sh ]; then
/usr/bin/run-tests.sh "\${@:-bash}"
else
"\${@:-bash}"
fi
EOF
# now, switch to build user
USER build
VOLUME /home/build/build
WORKDIR /home/build/build
ENTRYPOINT [ "/usr/bin/bashwrapper" ]
|