-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
105 lines (90 loc) · 3.24 KB
/
Dockerfile
File metadata and controls
105 lines (90 loc) · 3.24 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
FROM ubuntu:22.04
# Non-interactive installs and locale
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8 \
LC_ALL=C.UTF-8 \
TZ=Europe/Paris
# Use bash for RUN so pipefail works reliably.
SHELL ["/bin/bash", "-c"]
# Base deps in one layer; set timezone cleanly
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
tzdata \
build-essential \
git \
wget \
curl \
vim \
time \
software-properties-common \
libpcre3-dev \
libpcre2-dev \
pkg-config \
libfl-dev \
bison \
flex \
gperf \
clang \
g++ \
zlib1g-dev \
gnupg \
autoconf \
automake \
libtool \
openjdk-17-jdk \
help2man && \
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
rm -rf /var/lib/apt/lists/*
ENV NVM_DIR=/usr/local/nvm
ENV NODE_VERSION=20.12.2
RUN mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
. $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default && \
npm install -g npm@10 && \
chmod -R 777 $NVM_DIR && \
echo 'export NVM_DIR="/usr/local/nvm"' >> /etc/bash.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /etc/bash.bashrc
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && apt-get install -y --no-install-recommends python3.11 python3.11-dev python3.11-venv && \
python3.11 -m ensurepip --upgrade && \
python3.11 -m pip install --upgrade pip && \
ln -sf /usr/bin/python3.11 /usr/local/bin/python3 && \
ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip3 && \
rm -rf /var/lib/apt/lists/*
# SWIG
ARG SWIG_VERSION=v4.2.1
RUN git clone https://github.com/swig/swig.git -b ${SWIG_VERSION} --depth=1 /tmp/swig && \
cd /tmp/swig && ./autogen.sh && \
./configure --prefix=/usr/local && \
make -j"$(nproc)" && make install && \
rm -rf /tmp/swig
# Latest CMake from Kitware APT
RUN set -euo pipefail; \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' > /etc/apt/sources.list.d/kitware.list && \
apt-get update && apt-get install -y --no-install-recommends cmake && \
rm -rf /var/lib/apt/lists/*
# Verilator (pinned)
ARG VERILATOR_VERSION=v5.018
RUN git clone https://github.com/verilator/verilator -b ${VERILATOR_VERSION} --depth=1 /tmp/verilator && \
cd /tmp/verilator && autoconf && \
./configure --prefix=/usr/local && \
make -j"$(nproc)" && \
make install && \
rm -rf /tmp/verilator
# Verify toolchain
RUN swig -version && cmake --version && verilator --version && java --version && python3 --version
# Build and install Picker from local source (copied into image)
ENV BUILD_XSPCOMM_SWIG=python,java
WORKDIR /workspace
COPY . /workspace/picker
RUN cd /workspace/picker && make && make install && make clean
SHELL ["/bin/bash", "-c"]
WORKDIR /workspace