anchor.diff:      unzip \
       wget
   
  -# Install opam and ocaml from GitHub (Ubuntu version causes problems)
  -RUN wget -qq https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh && \
  -    echo "/usr/local/bin" | sh install.sh && \
  -    opam init --disable-sandboxing --yes --compiler 4.07.1 && \
  -    eval $(opam env)
  -
  -# Force to use opam version of ocamlc.
  -ENV PATH="/root/.opam/4.07.1/bin:${PATH}"
  +USER opam
   
   # Create directory for external tools (Yices 2, JKind, CVC4)
  -RUN mkdir /tools
  +RUN mkdir ./tools
   
   # Retrieve Yices 2
   RUN wget -qq https://yices.csl.sri.com/releases/2.6.2/yices-2.6.2-x86_64-pc-linux-gnu-static-gmp.tar.gz \
    && tar xvf yices-2.6.2-x86_64-pc-linux-gnu-static-gmp.tar.gz \
  - && cp /yices-2.6.2/bin/yices-smt2 /tools/ \
  + && cp ./yices-2.6.2/bin/yices-smt2 ./tools/ \
    && echo Success || true
   
   # Retrieve JKind and CVC4 (required for certification)
   RUN wget -qq https://github.com/loonwerks/jkind/releases/download/v4.3.0/jkind-4.3.0.zip && unzip jkind-4.3.0.zip \
  - && cp /jkind/jkind /jkind/*.jar /tools/ \
  + && cp ./jkind/jkind ./jkind/*.jar ./tools/ \
    && wget -qq https://github.com/CVC4/CVC4/releases/download/1.8/cvc4-1.8-x86_64-linux-opt -O cvc4 \
  - && cp cvc4 /tools/ \
  + && cp cvc4 ./tools/ \
    && echo Success || true
   
  -# Command for DockerHub
  -RUN if [ -n "${COMMIT}" ] ; then \
  -  git clone --depth 25 --branch ${BRANCH} https://github.com/kind2-mc/kind2.git kind2-build && \
  -  cd kind2-build && git checkout ${COMMIT} && cd .. ; fi
  -
  -COPY . kind2-build/
  +COPY --chown=opam:opam . kind2-build/
   
   # Build Kind 2
   WORKDIR kind2-build
  -RUN opam install -y .
  +
  +# Note: we use remote OPAM repo until local one is updated
  +RUN eval $(opam env) && \
  +    opam repo set-url default https://opam.ocaml.org && \
  +    opam update && opam install -y . --deps-only && \
  +    make && strip bin/kind2
   
   FROM ubuntu:20.04
   # Install runtime dependencies:
  
positive.code:     && rm -rf /var/lib/apt/lists/* \
      && adduser --disabled-password --gecos KIND2 kind2
  
  COPY --from=builder /tools /bin/
  COPY --from=builder /root/.opam/4.07.1/bin/kind2 /
  
  # Entry point.
  USER kind2
  ENTRYPOINT ["./kind2"]
  
  
negative.code: FROM ocaml/opam:ubuntu-21.04-ocaml-4.12 as builder
  
  USER root
  
  RUN apt-get update && apt-get install -y \
      gcc \
      git \
  