mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 18:35:32 +00:00
We need to run `apt-get update` first before trying to install packages. We did update the package index when we built the base image, but that might have been some time ago so that the index is now outdated.
54 lines
1.5 KiB
Docker
54 lines
1.5 KiB
Docker
# Keyman is copyright (C) SIL Global. MIT License.
|
|
#
|
|
# ARGS used in this file:
|
|
# - ARG BASE_VERSION
|
|
# - ARG REQUIRED_EMSCRIPTEN_VERSION
|
|
|
|
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 Core Build Image"
|
|
|
|
USER root
|
|
RUN apt-get update && \
|
|
apt-get install -qy git jq llvm meson pkgconf xvfb xserver-xephyr metacity
|
|
|
|
# Pre-install emscripten
|
|
USER build
|
|
ARG REQUIRED_EMSCRIPTEN_VERSION=unset
|
|
RUN echo "Installing emscripten version ${REQUIRED_EMSCRIPTEN_VERSION}" && \
|
|
export EMSDK_KEEP_DOWNLOADS=1 && \
|
|
cd /home/build/ && \
|
|
git clone https://github.com/emscripten-core/emsdk.git && \
|
|
cd emsdk && \
|
|
./emsdk install ${REQUIRED_EMSCRIPTEN_VERSION} && \
|
|
./emsdk activate ${REQUIRED_EMSCRIPTEN_VERSION}
|
|
USER root
|
|
RUN echo "export EMSCRIPTEN_BASE=/home/build/emsdk/upstream/emscripten" >> /usr/bin/bashwrapper && \
|
|
echo "export KEYMAN_USE_EMSDK=1" >> /usr/bin/bashwrapper
|
|
|
|
# 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
|
|
|
|
# Pre-install node
|
|
RUN export NVM_DIR="/home/build/.nvm" && \
|
|
. /home/build/.nvm/nvm.sh && \
|
|
cd /home/build/emsdk/upstream/emscripten && \
|
|
npm install
|
|
|
|
VOLUME /home/build/build
|
|
WORKDIR /home/build/build
|
|
|
|
ENTRYPOINT [ "/usr/bin/bashwrapper" ]
|