Skip to content

Commit

Permalink
Add Containerfile.slim file.
Browse files Browse the repository at this point in the history
  • Loading branch information
anmaped committed Aug 3, 2024
1 parent 2c85a0e commit be14da6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-and-send-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: anmaped/rmtld3synth

- name: Build and push slim image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Containerfile.slim
push: true
tags: ${{ steps.meta.outputs.tags }}-slim
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image
- name: Build and push dev image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
Expand Down
32 changes: 32 additions & 0 deletions Containerfile.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM docker.io/ocamlpro/ocaml:4.14.2 as base

RUN sudo apk add python3 build-base bash

RUN opam switch create . ocaml-system --deps-only --locked

RUN opam pin add dolmen https://github.com/Gbury/dolmen.git#e81b130ac0fdcd7e2b08603648c54c8ead8fbd7b -y
RUN opam pin add dolmen-export https://github.com/Gbury/dolmen.git#e81b130ac0fdcd7e2b08603648c54c8ead8fbd7b -y

RUN git clone --branch v0.5-x https://github.com/anmaped/rmtld3synth.git
RUN git clone --branch z3-4.12.3 https://github.com/Z3Prover/z3.git

RUN opam install zarith ppx_sexp_conv sexplib bigarray-compat
RUN cd z3 && eval $(opam env) && python scripts/mk_make.py --ml --staticlib && cd build && make

# fix
RUN sed -i "s~api/ml/libz3ml~api/ml/libz3ml-static~g" z3/build/Makefile
RUN sed -i "s~api/ml/dllz3ml.so~api/ml/dllz3ml-static.so~g" z3/build/Makefile
RUN ls -l z3/build && sudo cp z3/build/libz3-static.a /usr/lib/libz3-static.a

RUN cd z3/build && eval $(opam env) && sudo make install

RUN sed -i "s/-cclib -lstdc++/:standard -cclib -static -cclib -no-pie/g" rmtld3synth/src/dune
RUN cd rmtld3synth && eval $(opam env) && ./configure --prefix=/usr && opam exec -- make all


FROM docker.io/alpine:3.20

COPY --from=base /home/ocaml/_opam/bin/rmtld3synth /usr/bin

#ENTRYPOINT /bin/sh
WORKDIR /root
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ compile: setup
dune build --profile release @install
dune build --profile release @test

setup: version z3
setup: version zsolver
cp src/interface/mathkernel_call.ml src/interface/mathkernel_call_.ml
echo "(* dummy js interface *)" >> src/js/helper_.ml

Expand Down
6 changes: 3 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ if [ -n "$Z3_VERSION" ] && [ "x$z3_solver" == "xtrue" ]; then
echo "Z3 Version Found: $Z3_VERSION"

if $(vercmp "$Z3_VERSION" "4.7.1" "<="); then
echo -e "\nz3:
echo -e "\nzsolver:
\tcp src/interface/z3solver.ml src/interface/z3solver_.ml" >>Makefile
else
echo -e "\nz3:
echo -e "\nzsolver:
\tcp src/interface/z3solver_newAPI.ml src/interface/z3solver_.ml" >>Makefile
fi

else
echo -e "\nz3:
echo -e "\nzsolver:
\tcp src/interface/z3solver_dummy.ml src/interface/z3solver_.ml" >>Makefile
sed -i 's/z3//' src/interface/dune
fi
Expand Down

0 comments on commit be14da6

Please sign in to comment.