Skip to content

Commit d335728

Browse files
committed
Docker/Podman: add scripts for building Ubuntu24-based development image.
1 parent a79e105 commit d335728

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

docker/buildUbuntu2404.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# This file is part of JavaSMT,
4+
# an API wrapper for a collection of SMT solvers:
5+
# https://github.com/sosy-lab/java-smt
6+
#
7+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
8+
#
9+
# SPDX-License-Identifier: Apache-2.0
10+
11+
podman build \
12+
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
13+
-t registry.gitlab.com/sosy-lab/software/java-smt/develop:ubuntu2204 - < ubuntu2404.Dockerfile
14+
15+
# For pushing to Gitlab registry, please create your personal access token:
16+
# https://gitlab.com/-/user_settings/personal_access_tokens
17+
# with read and write rights to the Gitlab registry (full API access is not required)
18+
#
19+
# Please use the following commands to push the build image to Gitlab:
20+
# podman login registry.gitlab.com
21+
# podman push registry.gitlab.com/sosy-lab/software/java-smt/develop:ubuntu2404

docker/runUbuntu2404.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# This file is part of JavaSMT,
4+
# an API wrapper for a collection of SMT solvers:
5+
# https://github.com/sosy-lab/java-smt
6+
#
7+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
8+
#
9+
# SPDX-License-Identifier: Apache-2.0
10+
11+
# JavaSMT and all solver files are located in the directory WORKSPACE.
12+
# Derive WORKSPACE from the script's location (two directories up from current)
13+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14+
WORKSPACE="$(realpath "${SCRIPT_DIR}/../..")"
15+
16+
podman run -it \
17+
--mount type=bind,source=${WORKSPACE},target=/workspace \
18+
--workdir /workspace/java-smt \
19+
registry.gitlab.com/sosy-lab/software/java-smt/develop:ubuntu2404

docker/ubuntu2404.Dockerfile

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# This file is part of JavaSMT,
2+
# an API wrapper for a collection of SMT solvers:
3+
# https://github.com/sosy-lab/java-smt
4+
#
5+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
6+
#
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
FROM ubuntu:24.04
10+
11+
# set default locale
12+
RUN apt-get update \
13+
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
14+
tzdata locales locales-all \
15+
&& apt-get clean
16+
ENV LC_ALL=en_US.UTF-8
17+
ENV LANG=en_US.UTF-8
18+
ENV LANGUAGE=en_US.UTF-8
19+
20+
# Install basic packages for building several solvers
21+
RUN apt-get update \
22+
&& apt-get install -y \
23+
wget curl git build-essential cmake patchelf unzip \
24+
openjdk-11-jdk ant maven \
25+
gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix \
26+
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
27+
binutils-aarch64-linux-gnu libc6-dev-arm64-cross \
28+
zlib1g-dev m4 \
29+
&& apt-get clean
30+
31+
# Yices2 requires some dependencies
32+
RUN apt-get update \
33+
&& apt-get install -y \
34+
autoconf gperf \
35+
&& apt-get clean
36+
37+
# Bitwuzla requires Ninja and Meson (updated version from pip), and uses SWIG >4.0 from dependencies.
38+
# GMP >6.3.0 is automatically downloaded and build within Bitwuzla.
39+
RUN apt-get update \
40+
&& apt-get install -y \
41+
ninja-build python3-pip \
42+
&& apt-get clean
43+
RUN pip3 install --upgrade meson
44+
45+
# OpenSMT requires swig, gmp, flex and bison
46+
# - swig v4.1 or newer for unique_ptr support
47+
# - libpcre2-dev is a dependency of swig
48+
# - gmp needs to be recompiled to generate PIC code (see below)
49+
# - lzip is required to unpack the gmp tar ball
50+
RUN apt-get update \
51+
&& apt-get install -y \
52+
cmake flex bison libpcre2-dev lzip swig \
53+
&& apt-get clean
54+
55+
WORKDIR /dependencies
56+
57+
# Install GMP for linux on x64 and arm64
58+
# We could add another build for windows when needed
59+
RUN wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz \
60+
&& tar xf gmp-6.2.1.tar.lz \
61+
&& rm gmp-6.2.1.tar.lz \
62+
&& cd gmp-6.2.1 \
63+
&& ./configure \
64+
--enable-cxx \
65+
--with-pic \
66+
--disable-shared \
67+
--enable-fat \
68+
--prefix=/dependencies/gmp-6.2.1/install/x64-linux \
69+
&& make -j4 \
70+
&& make install \
71+
&& make clean \
72+
&& ./configure \
73+
--enable-cxx \
74+
--with-pic \
75+
--disable-shared \
76+
--enable-fat \
77+
--host=aarch64-linux-gnu \
78+
--prefix=/dependencies/gmp-6.2.1/install/arm64-linux \
79+
&& CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ LD=aarch64-linux-gnu-ld make -j4 \
80+
&& make install \
81+
&& make clean
82+
83+
# Install the Jdk for Windows x64
84+
RUN wget https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_windows-x64_bin.zip \
85+
&& unzip openjdk-11+28_windows-x64_bin.zip \
86+
&& mv jdk-11 jdk11-windows-x64 \
87+
&& rm openjdk-11+28_windows-x64_bin.zip
88+
89+
# Install the Jdk for Linux arm64
90+
RUN wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-aarch64_bin.tar.gz \
91+
&& tar -xzf openjdk-17.0.2_linux-aarch64_bin.tar.gz \
92+
&& mv jdk-17.0.2 jdk17-linux-aarch64 \
93+
&& rm openjdk-17.0.2_linux-aarch64_bin.tar.gz
94+
95+
# JNI is not found when compiling Boolector in the image, so we need to set JAVA_HOME
96+
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
97+
98+
# set labels for the image
99+
ARG BUILD_DATE
100+
LABEL org.opencontainers.image.created="${BUILD_DATE}"
101+
LABEL org.opencontainers.image.title="JavaSMT solver development"
102+
LABEL org.opencontainers.image.description="Ubuntu 24.04-based image for JavaSMT solver development"
103+
LABEL org.opencontainers.image.source="https://github.com/sosy-lab/java-smt"
104+
LABEL org.opencontainers.image.licenses="Apache-2.0"
105+
106+
# Podman-Specific Label for Auto-Update
107+
LABEL io.containers.autoupdate=registry
108+

0 commit comments

Comments
 (0)