Skip to content

Commit fe424ef

Browse files
committed
prepare for docker builds in CI
1 parent 3ee0c81 commit fe424ef

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

.github/workflows/docker.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: EasyCrypt Docker Containers Build and Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'latest'
8+
tags:
9+
- 'r[0-9]+.[0-9]+'
10+
workflow_dispatch
11+
12+
jobs:
13+
make-image:
14+
name: Make and Publish Container Images
15+
runs-on: ubuntu-24.04
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
target: [base, build, test]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Install docker and docker-buildx
23+
run: apt install docker docker-buildx
24+
- name: Build ${{ matrix.target }} Image
25+
run: TAG=${{ github.ref_name }} VARIANT=${{ matrix.target }} make -C scripts/docker publish
26+

scripts/docker/Dockerfile.base

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
FROM debian:stable
44

5-
MAINTAINER Pierre-Yves Strub <[email protected]>
5+
LABEL org.opencontainers.image.maintainer="Pierre-Yves Strub <[email protected]>"
66

77
ARG user=charlie
88

9-
ENV DEBIAN_FRONTEND noninteractive
9+
ENV DEBIAN_FRONTEND=noninteractive
1010

1111
RUN \
1212
apt-get -q -y update && \

scripts/docker/Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM ./Dockerfile.build
55
ARG EC_VERSION=main
66

77
RUN \
8-
opam pin --dev-repo \
8+
opam pin \
99
add -n easycrypt https://github.com/EasyCrypt/easycrypt.git#${EC_VERSION} && \
1010
opam install -v easycrypt && \
1111
rm -rf .opam/packages.dev/*

scripts/docker/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# --------------------------------------------------------------------
44
VARIANT ?= build
5+
TAG ?= main
56

67
# --------------------------------------------------------------------
78
.PHONY: default build publish
@@ -10,9 +11,9 @@ default: build
1011

1112
build:
1213
docker build -f Dockerfile.$(VARIANT) \
13-
--platform linux/amd64 \
14-
-t ghcr.io/easycrypt/ec-$(VARIANT)-box \
14+
--platform linux/amd64 \
15+
-t ghcr.io/easycrypt/ec-$(VARIANT)-box:$(TAG) \
1516
.
1617

1718
publish:
18-
docker push ghcr.io/easycrypt/ec-$(VARIANT)-box
19+
docker push ghcr.io/easycrypt/ec-$(VARIANT)-box:$(TAG)

0 commit comments

Comments
 (0)