Skip to content

Commit 31adb77

Browse files
committed
Coq 8.15.2
Using the same versions as Coq Platform 2022.04.1 for Coq 8.15. https://github.com/coq/platform/blob/main/package_picks/package-pick-8.15%7E2022.04.sh
1 parent f35ecb5 commit 31adb77

File tree

2 files changed

+45
-61
lines changed

2 files changed

+45
-61
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ jobs:
2626

2727
- name: Run Passing Example
2828
run: bin/run passing
29+
30+
- name: Report Image Size
31+
run: |
32+
echo "## Image Size" >> $GITHUB_STEP_SUMMARY
33+
docker image inspect --format '{{.Size}}' ghcr.io/codewars/coq:latest | numfmt --to=si --suffix=B >> $GITHUB_STEP_SUMMARY

Dockerfile

Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,59 @@
1-
FROM alpine:3.11 AS builder
2-
3-
RUN apk add --no-cache \
4-
bash \
5-
bubblewrap \
6-
build-base \
7-
ca-certificates \
8-
coreutils \
9-
curl \
10-
git \
11-
m4 \
12-
ncurses-dev \
13-
opam \
14-
ocaml \
15-
ocaml-compiler-libs \
16-
patch \
17-
rsync \
18-
tar \
19-
xz \
20-
;
21-
22-
# Disable sandboxing
23-
RUN set -ex; \
24-
echo 'wrap-build-commands: []' > ~/.opamrc; \
25-
echo 'wrap-install-commands: []' >> ~/.opamrc; \
26-
echo 'wrap-remove-commands: []' >> ~/.opamrc; \
27-
echo 'required-tools: []' >> ~/.opamrc;
1+
FROM alpine:3.16
282

293
ENV OPAMROOT=/opt/coq \
304
OPAMYES=1 \
315
OCAML_VERSION=default
32-
33-
RUN set -ex; \
34-
mkdir -p /opt/coq; \
35-
opam init --no-setup -j 4; \
36-
opam repo add coq-released http://coq.inria.fr/opam/released; \
37-
opam install -j 4 coq.8.12.0; \
38-
opam pin add coq 8.12.0; \
39-
opam install \
40-
-j 4 \
41-
coq-equations.1.2.3+8.12 \
42-
coq-mathcomp-ssreflect.1.11.0 \
43-
;
44-
456
ENV OPAM_SWITCH_PREFIX=/opt/coq/default
467
ENV CAML_LD_LIBRARY_PATH=$OPAM_SWITCH_PREFIX/lib/stublibs:$OPAM_SWITCH_PREFIX/lib/ocaml/stublibs:$OPAM_SWITCH_PREFIX/lib/ocaml \
478
OCAML_TOPLEVEL_PATH=$OPAM_SWITCH_PREFIX/lib/stublibs/lib/toplevel \
489
PATH=$OPAM_SWITCH_PREFIX/bin:$PATH
10+
4911
RUN set -ex; \
12+
mkdir -p /opt/coq; \
13+
# Work around https://github.com/ocaml/opam/issues/5186 by doing
14+
# `apk update` then cleaning up the cache in the same layer.
15+
apk update; \
16+
apk add \
17+
ocaml \
18+
; \
19+
apk add --virtual .build-deps \
20+
bash \
21+
build-base \
22+
bubblewrap \
23+
ca-certificates \
24+
curl \
25+
git \
26+
m4 \
27+
ocaml-ocamldoc \
28+
ocaml-compiler-libs \
29+
opam \
30+
tar \
31+
; \
32+
opam init -y --disable-sandboxing; \
33+
opam repo add coq-released http://coq.inria.fr/opam/released; \
34+
opam install -j 4 \
35+
# Let opam install system packages
36+
--confirm-level=unsafe-yes \
37+
# Use the same versions as Coq Platform so users can easily get the same versions.
38+
# https://github.com/coq/platform/blob/main/package_picks/package-pick-8.15%7E2022.04.sh
39+
coq.8.15.2 \
40+
coq-equations.1.3+8.15 \
41+
coq-mathcomp-ssreflect.1.14.0 \
42+
; \
5043
cd /opt; \
51-
git clone --depth 1 --branch v2.0.0 https://github.com/codewars/coq_codewars.git; \
44+
mkdir /opt/coq_codewars; \
45+
curl -sSL https://github.com/codewars/coq_codewars/archive/refs/tags/v2.0.0.tar.gz | tar xz -C /opt/coq_codewars --strip-components=1; \
5246
cd coq_codewars; \
5347
coq_makefile -f _CoqProject -o Makefile; \
54-
make;
55-
56-
57-
FROM alpine:3.11
48+
make; \
49+
opam clean --repo-cache; \
50+
apk del .build-deps; \
51+
rm -rf /var/cache/apk/*;
5852

5953
RUN adduser -D codewarrior
60-
RUN apk add --no-cache \
61-
build-base \
62-
ncurses-dev \
63-
ocaml \
64-
;
65-
COPY --from=builder /opt/coq /opt/coq
66-
COPY --from=builder /opt/coq_codewars/src /opt/coq_codewars/src
67-
COPY --from=builder /opt/coq_codewars/theories/Loader.vo /opt/coq_codewars/theories/Loader.vo
6854
RUN set -ex; \
6955
mkdir -p /workspace; \
70-
chown codewarrior:codewarrior /workspace;
56+
chown -R codewarrior: /workspace;
7157

7258
USER codewarrior
73-
ENV OPAM_SWITCH_PREFIX=/opt/coq/default
74-
ENV USER=codewarrior \
75-
HOME=/home/codewarrior \
76-
CAML_LD_LIBRARY_PATH=$OPAM_SWITCH_PREFIX/lib/stublibs:$OPAM_SWITCH_PREFIX/lib/ocaml/stublibs:$OPAM_SWITCH_PREFIX/lib/ocaml \
77-
OCAML_TOPLEVEL_PATH=$OPAM_SWITCH_PREFIX/lib/stublibs/lib/toplevel \
78-
PATH=$OPAM_SWITCH_PREFIX/bin:$PATH
79-
8059
WORKDIR /workspace

0 commit comments

Comments
 (0)