Skip to content

Commit

Permalink
WIP: modifies Dockerfile to create a multi-architecture image
Browse files Browse the repository at this point in the history
  • Loading branch information
ArquintL committed Dec 8, 2023
1 parent ff2ba14 commit dc1d679
Showing 1 changed file with 81 additions and 20 deletions.
101 changes: 81 additions & 20 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
# Gobra commit f21fe70
FROM ghcr.io/viperproject/gobra@sha256:0e7419455a3648d006e8a9957380e94c1a8e52d2d4b1ce2425af852dc275fb29

RUN apt-get update && \
apt-get install -y \
curl \
gcc \
wget \
jq \
build-essential \
checkinstall \
zlib1g-dev
FROM alpine/openssl
COPY --from=0 /gobra/gobra.jar /gobra/gobra.jar

# RUN apt-get update && \
# apt-get install -y \
# curl \
# gcc \
# wget \
# jq \
# git \
# openjdk-11-jdk \
# python
RUN apk update && \
apk add \
curl \
gcc \
wget \
jq \
git \
# openjdk-11-jdk \
openjdk11 \
python3
# build-essential \
# checkinstall \
# zlib1g-dev

# install openssl
RUN mkdir tmp && \
cd tmp && \
wget https://www.openssl.org/source/openssl-3.1.3.tar.gz && \
tar xvf openssl-3.1.3.tar.gz && \
cd openssl-3.1.3 && \
./config && \
make && \
make install && \
ldconfig && \
cd ../../ && \
rm -rf tmp
# RUN mkdir tmp && \
# cd tmp && \
# wget https://www.openssl.org/source/openssl-3.1.3.tar.gz && \
# tar xvf openssl-3.1.3.tar.gz && \
# cd openssl-3.1.3 && \
# ./config && \
# make && \
# make install && \
# ldconfig && \
# cd ../../ && \
# rm -rf tmp

WORKDIR /gobra

# install go
RUN mkdir tmp && \
Expand All @@ -32,6 +50,49 @@ RUN mkdir tmp && \
cd ../ && \
rm -rf tmp

RUN gcc --version

# # Install Z3
# RUN mkdir tmp && \
# cd tmp && \
# git clone https://github.com/Z3Prover/z3 && \
# cd z3 && \
# git checkout z3-4.8.7 && \
# CPPFLAGS="-march=native" CXXFLAGS="-march=native" CXX=gcc python scripts/mk_make.py --optimize && \
# cd build && \
# make install && \
# cd ../../../ && \
# rm -rf tmp
RUN if [ "$TARGETARCH" = "arm64" ]; then \
Z3_URL="https://github.com/viperproject/boogie-builder/raw/master/prebuilt_z3/z3-4.8.7-arm64-osx.zip" && \
curl -L $Z3_URL --output /z3.zip && \
unzip /z3.zip -d /z3/ && \
rm /z3.zip && \
cp /z3/$Z3_BIN /usr/bin/ && \
rm -r /z3; \
else \
Z3_URL="https://github.com/Z3Prover/z3/releases/download/z3-4.8.7/z3-4.8.7-x64-ubuntu-16.04.zip" && \
Z3_BIN="z3-4.8.7-x64-ubuntu-16.04/bin/z3" && \
curl -L $Z3_URL --output /z3.zip && \
unzip /z3.zip -d /z3/ && \
rm /z3.zip && \
cp /z3/$Z3_BIN /usr/bin/ && \
rm -r /z3; \
fi;

# # path to z3 binary unzipping Z3_ZIP:
# ENV Z3_BIN="z3-4.8.7-x64-ubuntu-16.04/bin/z3"


# # download z3 release from GitHub, unzip, and copy to bin:
# RUN curl -L $Z3_URL --output /z3.zip && \
# unzip /z3.zip -d /z3/ && \
# rm /z3.zip && \
# cp /z3/$Z3_BIN /usr/bin/ && \
# rm -r /z3

ENV Z3_EXE /usr/bin/z3

# add Go to path:
ENV PATH="${PATH}:/usr/local/go/bin"

Expand Down

0 comments on commit dc1d679

Please sign in to comment.