-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add CI image for building Keyman Core
- Loading branch information
1 parent
3e8adf8
commit 90fe8aa
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright (c) 2024 SIL International. All rights reserved. | ||
|
||
ARG BASE_VERSION | ||
FROM --platform=amd64 keymanapp/keyman-base-ci:${BASE_VERSION} | ||
|
||
LABEL org.opencontainers.image.authors="SIL International." | ||
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 install -qy git jq llvm meson pkgconf \ | ||
xvfb xserver-xephyr metacity | ||
|
||
#### TMP until we properly figure out the dependencies needed for Core | ||
#### We should not need to install /tmp/control | ||
# Install dependencies | ||
ADD control /tmp/control | ||
RUN apt-get install -qy python3 python3-setuptools python3-coverage \ | ||
devscripts equivs libdatetime-perl meson pkgconf lcov gcovr xvfb \ | ||
xserver-xephyr metacity mutter dbus-x11 weston xwayland && \ | ||
(yes | mk-build-deps --install /tmp/control) || true && \ | ||
rm /tmp/control | ||
#### TMP END | ||
|
||
# Install node | ||
ARG NODE_MAJOR | ||
RUN set -eu; \ | ||
NODE_VERSION=$(curl -sSL https://unofficial-builds.nodejs.org/download/release/ | cut -d'>' -f2 | cut -d'/' -f1 | grep v${NODE_MAJOR} | sort -V | tail -1) && \ | ||
echo "Installing node version ${NODE_VERSION}" && \ | ||
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64-glibc-217.tar.xz" && \ | ||
tar -xJf "node-${NODE_VERSION}-linux-x64-glibc-217.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && \ | ||
ln -s /usr/local/bin/node /usr/local/bin/nodejs | ||
|
||
# Install emscripten | ||
ARG EMSCRIPTEN_VERSION | ||
RUN echo "Installing emscripten version ${EMSCRIPTEN_VERSION}" && \ | ||
cd /usr/share && \ | ||
git clone https://github.com/emscripten-core/emsdk.git && \ | ||
cd emsdk && \ | ||
./emsdk install ${EMSCRIPTEN_VERSION} && \ | ||
./emsdk activate ${EMSCRIPTEN_VERSION} && \ | ||
echo "#!/bin/bash" > /usr/bin/bashwrapper && \ | ||
echo "export EMSCRIPTEN_BASE=/usr/share/emsdk/upstream/emscripten" >> /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 | ||
|
||
RUN chmod +x /usr/bin/bashwrapper && \ | ||
chown -R build:build $HOME | ||
|
||
# now, switch to build user | ||
USER build | ||
|
||
VOLUME /home/build/build | ||
WORKDIR /home/build/build | ||
|
||
ENTRYPOINT [ "/usr/bin/bashwrapper" ] |