Skip to content

Commit 60a24b9

Browse files
committed
WIP
1 parent 3636d4d commit 60a24b9

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
**/*.pyc
22
**/.merlin
3+
**/.mypy_cache
4+
**/.venv
35
**/__pycache__
46
**/_build
57
**/_opam

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ jobs:
8282
uses: docker/build-push-action@v6
8383
with:
8484
build-args: |
85-
OPAM_BASE=opam-centos-7
85+
CENTOS_BASE=centos:7
86+
OPAM_BASE=opam-centos-based
8687
OCAML_VERSION=4.14.2
8788
VERSION=${{ steps.build_version.outputs.value }}
8889
target: main

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*.pyc
22
.dmypy.json
33
.merlin
4+
.mypy_cache
5+
.venv
46
__pycache__
57
_build
68
_opam

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Base image for Debian-based distributions (e.g. `debian:10` or `ubuntu:18.04`)
22
ARG DEBIAN_BASE=ubuntu:18.04
33

4+
# Base image for CentOS-based distributions (e.g. `centos:7` or `centos:8`)
5+
ARG CENTOS_BASE=centos:7
6+
47
# Intermediate image to use as Opam-enabled distribution (e.g. `opam-alpine` or
58
# `opam-debian-based`).
6-
ARG OPAM_BASE=opam-centos-7
9+
ARG OPAM_BASE=opam-centos-based
710

811
FROM debian:12-slim AS downloader
912

@@ -78,13 +81,15 @@ RUN opam init --yes --compiler "$OCAML_VERSION" --disable-sandboxing
7881
RUN mkdir "/home/$user/workdir"
7982
WORKDIR "/home/$user/workdir"
8083

81-
FROM centos:7 AS opam-centos-7
84+
FROM $CENTOS_BASE AS opam-centos-based
8285

8386
# Fix repository URLs (because CentOS 7 is deprecated)
84-
RUN (. /etc/os-release && [ "$ID" = "centos" ] && [ "$VERSION_ID" = "7" ]) \
85-
&& sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo \
86-
&& sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo \
87-
&& sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
87+
RUN . /etc/os-release \
88+
&& if [ "$ID" = "centos" ] && ([ "$VERSION_ID" = "7" ] || [ "$VERSION_ID" = "8" ]); then \
89+
sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo; \
90+
sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo; \
91+
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo; \
92+
fi
8893

8994
# Add user with password-less sudo
9095
ARG user=main
@@ -101,10 +106,12 @@ USER "$user"
101106
USER root
102107
RUN yum install -y \
103108
bzip2 \
109+
diffutils \
104110
gcc \
105111
git \
106112
make \
107113
patch \
114+
rsync \
108115
unzip \
109116
wget \
110117
&& yum clean all \

0 commit comments

Comments
 (0)