bazel(ci): Fix Centos and Fedora docker

This commit is contained in:
Corentin Le Molgat
2023-07-21 13:47:29 +02:00
parent 0e2c41892f
commit c7794e2495
2 changed files with 16 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
# Create a virtual environment with all tools installed
# ref: https://quay.io/repository/centos/centos
FROM quay.io/centos/centos:stream AS env
# Install system build dependencies
ENV PATH=/usr/local/bin:$PATH
RUN dnf -y update \
@@ -11,17 +12,15 @@ RUN dnf -y update \
RUN echo "source /opt/rh/gcc-toolset-11/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]
# Install bazel 5
# see: https://docs.bazel.build/versions/main/install-redhat.html#installing-on-centos-7
RUN dnf config-manager --add-repo \
https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-8/vbatts-bazel-epel-8.repo \
&& dnf -y install bazel5 \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# Install Bazelisk
RUN wget \
https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
&& chmod +x bazelisk-linux-amd64 \
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
# Install Python
RUN dnf -y update \
&& dnf -y install python39-devel \
&& dnf -y install python3.11-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf

View File

@@ -1,17 +1,24 @@
# Create a virtual environment with all tools installed
# ref: https://hub.docker.com/_/fedora
FROM fedora:latest AS env
# Install system build dependencies
ENV PATH=/usr/local/bin:$PATH
RUN dnf -y update \
&& dnf -y install git \
&& dnf -y install git wget \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install gcc-c++ zlib-devel \
&& dnf -y install dnf-plugins-core \
&& dnf -y copr enable vbatts/bazel \
&& dnf -y install bazel5 which \
&& dnf -y install which \
&& dnf clean all
# Install Bazelisk
RUN wget \
https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
&& chmod +x bazelisk-linux-amd64 \
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
# Install Python
RUN dnf -y update \
&& dnf -y install python3 python3-devel python3-pip \