Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 49 additions & 6 deletions scripts/docker/Dockerfile.build → scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
# syntax = devthefuture/dockerfile-x
ARG BASE_LAYER=base
ARG BUILD_LAYER=build

FROM ./Dockerfile.base as base-build
# Base environment
FROM debian:stable AS base

LABEL org.opencontainers.image.maintainer="Pierre-Yves Strub <pierre-yves@strub.nu>"

ARG user=charlie

ENV DEBIAN_FRONTEND=noninteractive

RUN \
apt-get -q -y update && \
apt-get -q -y upgrade && \
apt-get -q -y install sudo && \
apt-get -q -y clean

COPY --chown=root:root --chmod=0400 docker-parts/sudoers /etc/sudoers.d/

RUN \
useradd -ms /bin/bash -d /home/$user -g root -G sudo -u 1001 $user

RUN \
apt-get -q -y install opam && \
apt-get -q -y clean

USER $user
WORKDIR /home/$user

ENV OPAMYES=true OPAMVERBOSE=0 OPAMJOBS=4

ARG OCAML_VERSION=4.14.2

RUN \
opam init --disable-sandboxing --compiler=ocaml-base-compiler.${OCAML_VERSION}

# Build environment
FROM ${BASE_LAYER} AS build

RUN \
sudo apt-get -q -y install wget curl python3 python3-pip python3-yaml && \
Expand Down Expand Up @@ -42,8 +78,6 @@ RUN \
opam clean --switch=alt-ergo-${version} && \
ln -s run-alt-ergo ~/bin/alt-ergo-${version}

FROM base-build as main-linux-amd64

RUN \
version=1.8 && \
wget -O cvc4 https://github.com/CVC4/CVC4-archived/releases/download/${version}/cvc4-${version}-x86_64-linux-opt && \
Expand Down Expand Up @@ -119,7 +153,16 @@ RUN \
sudo install -m 0755 z3 /usr/local/bin/z3-${version} && \
rm -f z3 z3.zip

FROM main-linux-amd64

RUN \
opam exec -- why3 config detect

# Test environment
FROM ${BUILD_LAYER} AS test

ARG EC_VERSION=main
ARG EC_REPO=https://github.com/EasyCrypt/easycrypt.git#${EC_VERSION}

RUN \
opam pin add -n easycrypt ${EC_REPO} && \
opam install -v easycrypt && \
rm -rf .opam/packages.dev/*
34 changes: 0 additions & 34 deletions scripts/docker/Dockerfile.base

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/docker/Dockerfile.formosa

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/docker/Dockerfile.test

This file was deleted.

5 changes: 3 additions & 2 deletions scripts/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
# --------------------------------------------------------------------
VARIANT ?= build
TAG ?= main
BARGS += --build-arg EC_VERSION=$(TAG)
VERSION ?= $(TAG)
BARGS += --build-arg EC_VERSION=$(VERSION)

# --------------------------------------------------------------------
.PHONY: default build publish

default: build

build:
docker build -f Dockerfile.$(VARIANT) \
docker build --target $(VARIANT) \
--platform linux/amd64 \
$(BARGS) \
-t ghcr.io/easycrypt/ec-$(VARIANT)-box:$(TAG) \
Expand Down
Loading