-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
57 lines (46 loc) · 1.9 KB
/
Dockerfile
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
57
# Base image: Node.js LTS (20) on Debian Bookworm (12)
FROM node:20-bookworm-slim AS wbs-dev-runner
# WBS tests use the Selenium Standalone image, so no need for the embedded Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# hadolint global ignore=DL3059
SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]
# Install necessary packages except Docker and PNPM
RUN apt-get update && \
apt-get --no-install-recommends -y install \
git \
curl \
jq \
python3-pip \
python3-venv \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*
# Install Docker CLI
RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
bash get-docker.sh && \
rm get-docker.sh
# Install hadolint Dockerfile linter (supports both AMD64 and ARM64)
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
curl -L https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -o /usr/local/bin/hadolint; \
elif [ "$ARCH" = "aarch64" ]; then \
curl -L https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-arm64 -o /usr/local/bin/hadolint; \
fi && \
chmod +x /usr/local/bin/hadolint
# Set up Python virtual environment and install Python packages (for black and update_commits.py)
RUN python3 -m venv /root/venv && \
/root/venv/bin/pip install --no-cache-dir --upgrade \
pip \
setuptools \
requests \
bs4 \
lxml \
black
WORKDIR /workspace
# Setup Git
RUN git config --global --add safe.directory /workspace
# Install PNPM
RUN curl -fsSL https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" PNPM_VERSION=9.6.0 bash -
ENV PATH="/root/.local/share/pnpm:${PATH}"
# Add npm module bins and activate Python venv virtual environment
ENV PATH="/workspace/node_modules/.bin:/root/venv/bin:$PATH"
ENTRYPOINT [ "./entrypoint.sh" ]