-
Notifications
You must be signed in to change notification settings - Fork 119
/
Dockerfile.release
44 lines (36 loc) · 1.23 KB
/
Dockerfile.release
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
FROM ubuntu:22.04
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y \
opam \
build-essential \
libgmp-dev \
z3 \
pkg-config \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Configure sudoers for the 'opam' user without requiring a password
RUN mkdir -p /etc/sudoers.d/ && \
echo 'opam ALL=(ALL:ALL) NOPASSWD:ALL' > /etc/sudoers.d/opam && \
chmod 440 /etc/sudoers.d/opam && \
chown root:root /etc/sudoers.d/opam
# Create and configure the 'opam' user
RUN adduser --disabled-password --gecos '' opam && \
passwd -l opam && \
chown -R opam:opam /home/opam
# Switch to the 'opam' user
USER opam
ENV HOME /home/opam
# Initialize opam and install packages
RUN opam init --disable-sandboxing --auto-setup && \
eval $(opam env) && \
opam repository add rems https://github.com/rems-project/opam-repository.git && \
opam install -y sail
# Copy the entry point script and set the correct permissions
COPY --chown=opam docker_entry_point.sh /home/opam/
RUN chmod +x /home/opam/docker_entry_point.sh
# Set the work directory to /data
WORKDIR /data
# Define the entry point script
ENTRYPOINT ["/home/opam/docker_entry_point.sh"]