2024-01-30 16:19:53 +00:00
|
|
|
FROM node:20.11-bookworm-slim AS node-image
|
2024-02-04 03:25:45 +00:00
|
|
|
FROM python:3.12.1-slim-bookworm
|
2020-12-06 20:17:17 +00:00
|
|
|
|
2022-05-04 20:22:50 +00:00
|
|
|
# Requirements for building packages
|
2020-12-06 20:17:17 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
2022-05-04 20:22:50 +00:00
|
|
|
bzip2 ccache f2c g++ gfortran git make \
|
2021-06-26 08:34:31 +00:00
|
|
|
patch pkg-config swig unzip wget xz-utils \
|
|
|
|
autoconf autotools-dev automake texinfo dejagnu \
|
2024-01-30 16:19:53 +00:00
|
|
|
build-essential libtool libltdl-dev \
|
2022-06-30 04:22:03 +00:00
|
|
|
gnupg2 libdbus-glib-1-2 sudo sqlite3 \
|
2023-01-27 01:22:05 +00:00
|
|
|
ninja-build jq xxd \
|
2022-05-04 20:22:50 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2018-10-08 19:33:33 +00:00
|
|
|
|
2023-01-10 01:57:07 +00:00
|
|
|
# Normally, it is a bad idea to install rustup and cargo in
|
|
|
|
# system directories (it should not be shared between users),
|
|
|
|
# but this docker image is only for building packages, so I hope it is ok.
|
|
|
|
RUN wget -q -O - https://sh.rustup.rs | \
|
|
|
|
RUSTUP_HOME=/usr CARGO_HOME=/usr sh -s -- -y --profile minimal --no-modify-path
|
2021-07-20 08:48:27 +00:00
|
|
|
|
2023-01-27 03:30:13 +00:00
|
|
|
# install autoconf 2.71, required by upstream libffi
|
2024-11-11 17:00:28 +00:00
|
|
|
RUN wget https://mirrors.ocf.berkeley.edu/gnu/autoconf/autoconf-2.71.tar.xz \
|
2023-01-27 03:30:13 +00:00
|
|
|
&& tar -xf autoconf-2.71.tar.xz \
|
|
|
|
&& cd autoconf-2.71 \
|
|
|
|
&& ./configure \
|
|
|
|
&& make install \
|
|
|
|
&& cp /usr/local/bin/autoconf /usr/bin/autoconf \
|
|
|
|
&& rm -rf autoconf-2.71
|
|
|
|
|
2023-01-10 01:57:07 +00:00
|
|
|
ADD requirements.txt docs/requirements-doc.txt /
|
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
RUN pip3 --no-cache-dir install -r requirements.txt \
|
|
|
|
&& pip3 --no-cache-dir install -r requirements-doc.txt \
|
2024-07-26 14:51:57 +00:00
|
|
|
&& rm -rf requirements.txt requirements-doc.txt
|
2018-10-08 19:33:33 +00:00
|
|
|
|
2024-11-11 10:38:38 +00:00
|
|
|
RUN cd / \
|
|
|
|
&& git clone --recursive https://github.com/WebAssembly/wabt \
|
|
|
|
&& cd wabt \
|
|
|
|
&& git submodule update --init \
|
|
|
|
&& make install-gcc-release-no-tests \
|
|
|
|
&& cd ~ \
|
|
|
|
&& rm -rf /wabt
|
|
|
|
|
|
|
|
COPY --from=node-image /usr/local/bin/node /usr/local/bin/
|
|
|
|
COPY --from=node-image /usr/local/lib/node_modules /usr/local/lib/node_modules
|
|
|
|
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
|
|
|
|
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
|
|
|
|
|
|
|
|
RUN npm install -g \
|
|
|
|
jsdoc \
|
|
|
|
prettier \
|
|
|
|
rollup \
|
|
|
|
rollup-plugin-terser
|
|
|
|
|
2022-02-09 12:23:05 +00:00
|
|
|
# Get Chrome and Firefox (borrowed from https://github.com/SeleniumHQ/docker-selenium)
|
2018-10-08 19:33:33 +00:00
|
|
|
|
2022-02-09 12:23:05 +00:00
|
|
|
ARG CHROME_VERSION="latest"
|
|
|
|
ARG FIREFOX_VERSION="latest"
|
|
|
|
# Note: geckodriver version needs to be updated manually
|
2024-03-12 10:28:33 +00:00
|
|
|
ARG GECKODRIVER_VERSION="0.34.0"
|
2022-02-09 12:23:05 +00:00
|
|
|
|
|
|
|
#============================================
|
2023-05-15 17:09:23 +00:00
|
|
|
# Firefox & geckodriver
|
2022-02-09 12:23:05 +00:00
|
|
|
#============================================
|
|
|
|
# can specify Firefox version by FIREFOX_VERSION;
|
|
|
|
# e.g. latest
|
|
|
|
# 95
|
|
|
|
# 96
|
|
|
|
#
|
|
|
|
# can specify Firefox geckodriver version by GECKODRIVER_VERSION;
|
|
|
|
#============================================
|
|
|
|
|
|
|
|
RUN if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ]; \
|
|
|
|
then FIREFOX_DOWNLOAD_URL="https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION-ssl&os=linux64&lang=en-US"; \
|
|
|
|
else FIREFOX_VERSION_FULL="${FIREFOX_VERSION}.0" && FIREFOX_DOWNLOAD_URL="https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION_FULL/linux-x86_64/en-US/firefox-$FIREFOX_VERSION_FULL.tar.bz2"; \
|
|
|
|
fi \
|
|
|
|
&& wget --no-verbose -O /tmp/firefox.tar.bz2 $FIREFOX_DOWNLOAD_URL \
|
|
|
|
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
|
|
|
|
&& rm /tmp/firefox.tar.bz2 \
|
|
|
|
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \
|
|
|
|
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/local/bin/firefox \
|
|
|
|
&& wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz \
|
|
|
|
&& rm -rf /opt/geckodriver \
|
|
|
|
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
|
|
|
|
&& rm /tmp/geckodriver.tar.gz \
|
|
|
|
&& mv /opt/geckodriver /opt/geckodriver-$GECKODRIVER_VERSION \
|
|
|
|
&& chmod 755 /opt/geckodriver-$GECKODRIVER_VERSION \
|
|
|
|
&& ln -fs /opt/geckodriver-$GECKODRIVER_VERSION /usr/local/bin/geckodriver \
|
|
|
|
&& echo "Using Firefox version: $(firefox --version)" \
|
|
|
|
&& echo "Using GeckoDriver version: "$GECKODRIVER_VERSION
|
|
|
|
|
|
|
|
|
|
|
|
#============================================
|
|
|
|
# Google Chrome & Chrome webdriver
|
|
|
|
#============================================
|
|
|
|
# can specify Chrome version by CHROME_VERSION;
|
|
|
|
# e.g. latest
|
|
|
|
# 96
|
|
|
|
# 97
|
|
|
|
#============================================
|
|
|
|
|
|
|
|
RUN if [ $CHROME_VERSION = "latest" ]; \
|
2024-03-12 10:28:33 +00:00
|
|
|
then CHROME_VERSION_FULL=$(wget --no-verbose -O - "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE"); \
|
|
|
|
else CHROME_VERSION_FULL=$(wget --no-verbose -O - "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_VERSION}"); \
|
2022-02-09 12:23:05 +00:00
|
|
|
fi \
|
|
|
|
&& CHROME_DOWNLOAD_URL="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION_FULL}-1_amd64.deb" \
|
2024-03-12 10:28:33 +00:00
|
|
|
&& CHROMEDRIVER_DOWNLOAD_URL="https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION_FULL}/linux64/chromedriver-linux64.zip" \
|
2022-02-09 12:23:05 +00:00
|
|
|
&& wget --no-verbose -O /tmp/google-chrome.deb ${CHROME_DOWNLOAD_URL} \
|
2022-05-04 20:22:50 +00:00
|
|
|
&& apt-get update \
|
2022-02-09 12:23:05 +00:00
|
|
|
&& apt install -qqy /tmp/google-chrome.deb \
|
|
|
|
&& rm -f /tmp/google-chrome.deb \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2024-03-12 10:28:33 +00:00
|
|
|
&& wget --no-verbose -O /tmp/chromedriver-linux64.zip ${CHROMEDRIVER_DOWNLOAD_URL} \
|
|
|
|
&& unzip /tmp/chromedriver-linux64.zip -d /opt/ \
|
|
|
|
&& rm /tmp/chromedriver-linux64.zip \
|
|
|
|
&& ln -fs /opt/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver \
|
2022-02-09 12:23:05 +00:00
|
|
|
&& echo "Using Chrome version: $(google-chrome --version)" \
|
2024-03-12 10:28:33 +00:00
|
|
|
&& echo "Using Chrome Driver version: $(chromedriver --version)"
|
2018-10-15 12:05:58 +00:00
|
|
|
|
|
|
|
CMD ["/bin/sh"]
|
2018-10-08 19:33:33 +00:00
|
|
|
WORKDIR /src
|