-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
89 lines (79 loc) · 2.55 KB
/
Dockerfile
File metadata and controls
89 lines (79 loc) · 2.55 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
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 \
sudo \
wget \
curl \
vim \
software-properties-common \
python3 \
python3-pip \
python3-dev \
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/*
# 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
# Create a non-root user for interactive use
RUN useradd -m -s /bin/bash user && \
adduser user sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R user:user /workspace
USER user
SHELL ["/bin/bash", "-c"]
WORKDIR /workspace