bazel(ci): Add almalinux and rockylinux, remove centos
This commit is contained in:
28
.github/workflows/amd64_docker_bazel.yml
vendored
28
.github/workflows/amd64_docker_bazel.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# ref: https://github.com/actions/runner-images
|
||||
# ref: https://github.com/docker-library/official-images
|
||||
name: amd64 Docker Bazel
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
@@ -7,17 +7,31 @@ jobs:
|
||||
bazel:
|
||||
strategy:
|
||||
matrix:
|
||||
distro: [archlinux, debian, fedora, opensuse, ubuntu]
|
||||
platform: [amd64] # arm64 riscv64
|
||||
distro: [
|
||||
almalinux,
|
||||
# alpine,
|
||||
archlinux,
|
||||
debian,
|
||||
fedora,
|
||||
opensuse,
|
||||
rockylinux,
|
||||
ubuntu
|
||||
]
|
||||
fail-fast: false
|
||||
name: ${{ matrix.distro }} • Bazel • C++
|
||||
name: ${{ matrix.platform }} • ${{ matrix.distro }} • Bazel
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check docker
|
||||
run: |
|
||||
docker info
|
||||
docker buildx ls
|
||||
- name: Build env image
|
||||
run: make --directory=bazel ${{ matrix.distro }}_env
|
||||
run: make --directory=bazel ${{ matrix.platform }}_${{ matrix.distro }}_env
|
||||
- name: Build devel image
|
||||
run: make --directory=bazel ${{ matrix.distro }}_devel
|
||||
run: make --directory=bazel ${{ matrix.platform }}_${{ matrix.distro }}_devel
|
||||
- name: Build project
|
||||
run: make --directory=bazel ${{ matrix.distro }}_build
|
||||
run: make --directory=bazel ${{ matrix.platform }}_${{ matrix.distro }}_build
|
||||
- name: Test project
|
||||
run: make --directory=bazel ${{ matrix.distro }}_test
|
||||
run: make --directory=bazel ${{ matrix.platform }}_${{ matrix.distro }}_test
|
||||
|
||||
185
bazel/Makefile
185
bazel/Makefile
@@ -31,32 +31,57 @@ help:
|
||||
@echo -e "${BOLD}MAKE TARGETS${RESET}"
|
||||
@echo -e "\t${BOLD}help${RESET}: display this help and exit."
|
||||
@echo
|
||||
@echo -e "\t${BOLD}<stage>${RESET}: build all <stage> docker images."
|
||||
@echo -e "\t${BOLD}<distro>_<stage>${RESET}: build the <stage> docker image for a specific distro."
|
||||
@echo -e "\t${BOLD}save_<stage>${RESET}: Save all <stage> docker images."
|
||||
@echo -e "\t${BOLD}save_<distro>_<stage>${RESET}: Save the <stage> docker image for a specific distro."
|
||||
@echo -e "\t${BOLD}sh_<distro>_<stage>${RESET}: run a container using the <stage> docker image (debug purpose)."
|
||||
@echo -e "\tBuild using docker and the host platform."
|
||||
@echo -e "\t${BOLD}<distro>_<stage>${RESET}: build a <stage> docker image for a specific distro."
|
||||
@echo -e "\t${BOLD}save_<distro>_<stage>${RESET}: Save a <stage> docker image for a specific distro."
|
||||
@echo -e "\t${BOLD}sh_<distro>_<stage>${RESET}: run a container using the <stage> docker image specified (debug purpose)."
|
||||
@echo -e "\t${BOLD}clean_<distro>_<stage>${RESET}: Remove cache and docker image."
|
||||
@echo -e "\t${BOLD}clean_native${RESET}: Remove ALL caches and docker images."
|
||||
@echo
|
||||
@echo -e "\t${BOLD}<stage>${RESET}:"
|
||||
@echo -e "\tWith ${BOLD}<distro>${RESET}:"
|
||||
@echo -e "\t\t${BOLD}almalinux${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}alpine${RESET} (edge)"
|
||||
@echo -e "\t\t${BOLD}archlinux${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}debian${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}fedora${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}opensuse${RESET} (tumbleweed)"
|
||||
@echo -e "\t\t${BOLD}rockylinux${RESET} (9)"
|
||||
@echo -e "\t\t${BOLD}ubuntu${RESET} (rolling)"
|
||||
@echo -e "\t\t${BOLD}all${RESET} trigger ALL DISTROS."
|
||||
@echo
|
||||
@echo -e "\tWith ${BOLD}<stage>${RESET}:"
|
||||
@echo -e "\t\t${BOLD}env${RESET}"
|
||||
@echo -e "\t\t${BOLD}devel${RESET}"
|
||||
@echo -e "\t\t${BOLD}build${RESET}"
|
||||
@echo -e "\t\t${BOLD}test${RESET}"
|
||||
@echo
|
||||
@echo -e "\t${BOLD}<distro>${RESET}:"
|
||||
@echo -e "\t\t${BOLD}alpine${RESET} (edge)"
|
||||
@echo -e "\t\t${BOLD}archlinux${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}centos${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}debian${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}fedora${RESET} (latest)"
|
||||
@echo -e "\t\t${BOLD}opensuse${RESET} (tumbleweed)"
|
||||
@echo -e "\t\t${BOLD}ubuntu${RESET} (rolling)"
|
||||
@echo -e "\te.g. 'make ubuntu_test'"
|
||||
@echo
|
||||
@echo -e "\t${BOLD}clean${RESET}: Remove cache and ALL docker images."
|
||||
@echo -e "\t${BOLD}clean_<distro>${RESET}: Remove cache and docker images for the specified distro."
|
||||
@echo -e "\tBuild using docker buildx with a platform specified."
|
||||
@echo -e "\t${BOLD}<platform>_<stage>${RESET}: build <stage> docker images for ALL DISTROS."
|
||||
@echo -e "\t${BOLD}<platform>_<distro>_<stage>${RESET}: build <stage> docker image for a specific distro."
|
||||
@echo -e "\t${BOLD}save_<platform>_<stage>${RESET}: Save <stage> docker images for ALL DISTROS."
|
||||
@echo -e "\t${BOLD}save_<platform>_<distro>_<stage>${RESET}: Save the <stage> docker image for a specific distro."
|
||||
@echo -e "\t${BOLD}sh_<platform>_<distro>_<stage>${RESET}: run a container using the <stage> docker image specified (debug purpose)."
|
||||
@echo -e "\t${BOLD}clean_<platform>_<distro>_<stage>${RESET}: Remove cache and docker image."
|
||||
@echo -e "\t${BOLD}clean_platforms${RESET}: Remove ALL cache and docker image."
|
||||
@echo
|
||||
@echo -e "\tWith ${BOLD}<platform>${RESET}:"
|
||||
@echo -e "\t\t${BOLD}amd64${RESET}: linux/amd64 (x86_64)"
|
||||
@echo -e "\t\t${BOLD}arm64${RESET}: linux/arm64 (aarch64, arm64v8)"
|
||||
@echo -e "\t\t${BOLD}mips64${RESET}: linux/mips64 (mips 64bits)"
|
||||
@echo -e "\t\t${BOLD}mips64le${RESET}: linux/mips64le (mips 64bits Little Endian)"
|
||||
@echo -e "\t\t${BOLD}ppc64${RESET}: linux/ppc64 (PowerPC 64Bits)"
|
||||
@echo -e "\t\t${BOLD}ppc64le${RESET}: linux/ppc64le (PowerPC 64Bits Little Endian)"
|
||||
@echo -e "\t\t${BOLD}riscv64${RESET}: linux/riscv64 (RISC-V 64bits)"
|
||||
@echo -e "\te.g. 'make amd64_ubuntu_test'"
|
||||
@echo -e "\tDocker image unavailable: arm64_archlinux"
|
||||
@echo
|
||||
@echo -e "\tGlobal targets."
|
||||
@echo -e "\t${BOLD}clean${RESET}: Remove ALL caches and docker images."
|
||||
@echo -e "\t${BOLD}distclean${RESET}: Remove everything."
|
||||
@echo
|
||||
@echo -e "\t${BOLD}NOCACHE=1${RESET}: use 'docker build --no-cache' when building container (default use cache)."
|
||||
@echo -e "\t${BOLD}VERBOSE=1${RESET}: use 'docker build --progress=plain' when building container."
|
||||
@echo
|
||||
@echo -e "branch: $(BRANCH)"
|
||||
@echo -e "sha1: $(SHA1)"
|
||||
@@ -64,7 +89,7 @@ help:
|
||||
# Need to add cmd_distro to PHONY otherwise target are ignored since they do not
|
||||
# contain recipe (using FORCE do not work here)
|
||||
.PHONY: all
|
||||
all: build
|
||||
all: all_test
|
||||
|
||||
# Delete all implicit rules to speed up makefile
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
@@ -78,36 +103,52 @@ SUFFIXES :=
|
||||
# Docker image name prefix.
|
||||
IMAGE := ${PROJECT}/${BUILD_SYSTEM}
|
||||
|
||||
ifdef NOCACHE
|
||||
DOCKER_BUILD_CMD := docker build --no-cache
|
||||
else
|
||||
DOCKER_BUILD_CMD := docker build
|
||||
DOCKER_BUILDX_CMD := docker buildx build
|
||||
ifdef NOCACHE
|
||||
DOCKER_BUILD_CMD := ${DOCKER_BUILD_CMD} --no-cache
|
||||
DOCKER_BUILDX_CMD := ${DOCKER_BUILDX_CMD} --no-cache
|
||||
endif
|
||||
ifdef VERBOSE
|
||||
DOCKER_BUILD_CMD := ${DOCKER_BUILD_CMD} --progress=plain
|
||||
DOCKER_BUILDX_CMD := ${DOCKER_BUILDX_CMD} --progress=plain
|
||||
endif
|
||||
DOCKER_RUN_CMD := docker run --rm --init --net=host
|
||||
|
||||
# Currently supported distro
|
||||
DISTROS := alpine archlinux centos debian fedora opensuse ubuntu
|
||||
DISTROS := \
|
||||
almalinux \
|
||||
alpine \
|
||||
archlinux \
|
||||
debian \
|
||||
fedora \
|
||||
opensuse \
|
||||
rockylinux \
|
||||
ubuntu
|
||||
|
||||
# $* stem
|
||||
# $< first prerequist
|
||||
# $@ target name
|
||||
|
||||
############
|
||||
## STAGES ##
|
||||
############
|
||||
STAGES := env devel build test
|
||||
|
||||
define make-stage-target =
|
||||
#$$(info STAGE: $1)
|
||||
.PHONY: $1
|
||||
#$$(info Create targets: $1 $(addsuffix _$1, $(DISTROS)).)
|
||||
#$$(info Create targets: all_$1 $(addsuffix _$1, $(DISTROS)).)
|
||||
targets_$1 = $(addsuffix _$1, $(DISTROS))
|
||||
.PHONY: $(targets_$1)
|
||||
$1: $$(targets_$1)
|
||||
.PHONY: all_$1 $$(targets_$1)
|
||||
all_$1: $$(targets_$1)
|
||||
$$(targets_$1): %_$1: docker/%/Dockerfile
|
||||
#@docker image rm -f ${IMAGE}:$$*_$1 2>/dev/null
|
||||
${DOCKER_BUILD_CMD} --target=$1 --tag ${IMAGE}:$$*_$1 -f $$< ..
|
||||
|
||||
#$$(info Create targets: save_$1 $(addprefix save_, $(addsuffix _$1, $(DISTROS))) (debug).)
|
||||
#$$(info Create targets: save_all_$1 $(addprefix save_, $(addsuffix _$1, $(DISTROS))) (debug).)
|
||||
save_targets_$1 = $(addprefix save_, $(addsuffix _$1, $(DISTROS)))
|
||||
.PHONY: save_$1 $(save_targets_$1)
|
||||
save_$1: $$(save_targets_$1)
|
||||
.PHONY: save_all_$1 $$(save_targets_$1)
|
||||
save_all_$1: $$(save_targets_$1)
|
||||
$$(save_targets_$1): save_%_$1: cache/%/docker_$1.tar
|
||||
cache/%/docker_$1.tar: %_$1
|
||||
@rm -f $$@
|
||||
@@ -116,14 +157,14 @@ cache/%/docker_$1.tar: %_$1
|
||||
|
||||
#$$(info Create targets: $(addprefix sh_, $(addsuffix _$1, $(DISTROS))) (debug).)
|
||||
sh_targets_$1 = $(addprefix sh_, $(addsuffix _$1, $(DISTROS)))
|
||||
.PHONY: $(sh_targets_$1)
|
||||
.PHONY: $$(sh_targets_$1)
|
||||
$$(sh_targets_$1): sh_%_$1: %_$1
|
||||
${DOCKER_RUN_CMD} -it --name ${PROJECT}_${BUILD_SYSTEM}_$$*_$1 ${IMAGE}:$$*_$1
|
||||
|
||||
#$$(info Create targets: clean_$1 $(addprefix clean_, $(addsuffix _$1, $(DISTROS))).)
|
||||
#$$(info Create targets: clean_all_$1 $(addprefix clean_, $(addsuffix _$1, $(DISTROS))).)
|
||||
clean_targets_$1 = $(addprefix clean_, $(addsuffix _$1, $(DISTROS)))
|
||||
.PHONY: clean_$1 $(clean_targets_$1)
|
||||
clean_$1: $$(clean_targets_$1)
|
||||
.PHONY: clean_all_$1 $$(clean_targets_$1)
|
||||
clean_all_$1: $$(clean_targets_$1)
|
||||
$$(clean_targets_$1): clean_%_$1:
|
||||
docker image rm -f ${IMAGE}:$$*_$1 2>/dev/null
|
||||
rm -f cache/$$*/docker_$1.tar
|
||||
@@ -131,15 +172,83 @@ endef
|
||||
|
||||
$(foreach stage,$(STAGES),$(eval $(call make-stage-target,$(stage))))
|
||||
|
||||
## MERGE ##
|
||||
.PHONY: clean_all
|
||||
clean_all: $(addprefix clean_all_, $(STAGES))
|
||||
rm -f $(addprefix cache/, $(DISTROS))
|
||||
|
||||
##############
|
||||
## PLATFORM ##
|
||||
##############
|
||||
# ref: https://go.dev/doc/install/source#environment
|
||||
# ref: https://github.com/containerd/containerd/blob/269548fa27e0089a8b8278fc4fc781d7f65a939b/platforms/platforms.go#L80-L94
|
||||
PLATFORMS := \
|
||||
amd64 \
|
||||
arm64 \
|
||||
mips64 mips64le \
|
||||
ppc64 ppc64le \
|
||||
riscv64
|
||||
|
||||
define make-platform-stage-target =
|
||||
#$$(info PLATFORM: '$1' STAGE: '$2')
|
||||
#$$(info Create targets: $1_all_$2 $(addprefix $1_, $(addsuffix _$2, $(DISTROS))).)
|
||||
targets_$1_$2 = $(addprefix $1_, $(addsuffix _$2, $(DISTROS)))
|
||||
.PHONY: $1_all_$2 $$(targets_$1_$2)
|
||||
$1_all_$2: $$(targets_$1_$2)
|
||||
$$(targets_$1_$2): $1_%_$2: docker/%/Dockerfile
|
||||
#@docker image rm -f ${IMAGE}:$1_$$*_$2 2>/dev/null
|
||||
${DOCKER_BUILDX_CMD} --platform linux/$1 --target=$2 --tag ${IMAGE}:$1_$$*_$2 -f $$< ..
|
||||
|
||||
#$$(info Create targets: save_$1_all_$2 $(addprefix save_$1_, $(addsuffix _$2, $(DISTROS))) (debug).)
|
||||
save_targets_$1_$2 = $(addprefix save_$1_, $(addsuffix _$2, $(DISTROS)))
|
||||
.PHONY: save_$1_all_$2 $$(save_targets_$1_$2)
|
||||
save_$1_all_$2: $$(save_targets_$1_$2)
|
||||
$$(save_targets_$1_$2): save_$1_%_$2: cache/$1/%/docker_$2.tar
|
||||
cache/$1/%/docker_$2.tar: $1_%_$2
|
||||
@rm -f $$@
|
||||
mkdir -p cache/$1/$$*
|
||||
docker save ${IMAGE}:$1_$$*_$2 -o $$@
|
||||
|
||||
#$$(info Create targets: $(addprefix sh_$1_, $(addsuffix _$2, $(DISTROS))) (debug).)
|
||||
sh_targets_$1_$2 = $(addprefix sh_$1_, $(addsuffix _$2, $(DISTROS)))
|
||||
.PHONY: $$(sh_targets_$1_$2)
|
||||
$$(sh_targets_$1_$2): sh_$1_%_$2: $1_%_$2
|
||||
${DOCKER_RUN_CMD} --platform linux/$1 -it --name ${PROJECT}_${BUILD_SYSTEM}_$1_$$*_$2 ${IMAGE}:$1_$$*_$2
|
||||
|
||||
#$$(info Create targets: clean_$1_all_$2 $(addprefix clean_$1_, $(addsuffix _$2, $(DISTROS))).)
|
||||
clean_targets_$1_$2 = $(addprefix clean_$1_, $(addsuffix _$2, $(DISTROS)))
|
||||
.PHONY: clean_$1_all_$2 $$(clean_targets_$1_$2)
|
||||
clean_$1_all_$2: $$(clean_targets_$1_$2)
|
||||
$$(clean_targets_$1_$2): clean_$1_%_$2:
|
||||
docker image rm -f ${IMAGE}:$1_$$*_$2 2>/dev/null
|
||||
rm -f cache/$1/$$*/docker_$2.tar
|
||||
endef
|
||||
|
||||
define make-platform-target =
|
||||
#$$(info PLATFORM: $1)
|
||||
$(foreach stage,$(STAGES),$(eval $(call make-platform-stage-target,$1,$(stage))))
|
||||
|
||||
# merge
|
||||
.PHONY: clean_$1
|
||||
clean_$1: $(addprefix clean_$1_all_, $(STAGES))
|
||||
-rmdir $(addprefix cache/$1/, $(DISTROS))
|
||||
-rmdir cache/$1
|
||||
endef
|
||||
|
||||
$(foreach platform,$(PLATFORMS),$(eval $(call make-platform-target,$(platform))))
|
||||
|
||||
## MERGE ##
|
||||
.PHONY: clean_platforms
|
||||
clean_platforms: $(addprefix clean_, $(PLATFORMS))
|
||||
|
||||
###########
|
||||
## CLEAN ##
|
||||
clean_targets = $(addprefix clean_, $(DISTROS))
|
||||
.PHONY: clean $(clean_targets)
|
||||
clean: $(clean_targets)
|
||||
###########
|
||||
.PHONY: clean
|
||||
clean: clean_all clean_platforms
|
||||
docker container prune -f
|
||||
docker image prune -f
|
||||
-rmdir cache
|
||||
$(clean_targets): clean_%: $(addprefix clean_%_, $(STAGES))
|
||||
-rmdir cache/$*
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
|
||||
50
bazel/docker/almalinux/Dockerfile
Normal file
50
bazel/docker/almalinux/Dockerfile
Normal file
@@ -0,0 +1,50 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://hub.docker.com/_/almalinux
|
||||
FROM almalinux:latest AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install git wget zlib-devel gcc-toolset-13 \
|
||||
&& dnf -y groupinstall "Development Tools" \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/dnf
|
||||
|
||||
RUN echo "source /opt/rh/gcc-toolset-13/enable" >> /etc/bashrc
|
||||
SHELL ["/bin/bash", "--login", "-c"]
|
||||
|
||||
# Install Bazelisk
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
|
||||
# Install Java
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install java-11-openjdk java-11-openjdk-devel maven \
|
||||
&& dnf clean all
|
||||
ENV JAVA_HOME=/usr/lib/jvm/java-openjdk
|
||||
|
||||
# Install Python
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install python3-devel python3-pip \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/dnf
|
||||
|
||||
# Add the library src to our build env
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
@@ -1,17 +1,18 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://hub.docker.com/_/alpine
|
||||
FROM alpine:edge AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
RUN apk add --no-cache git build-base linux-headers zlib-dev
|
||||
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing bazel6
|
||||
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing bazel7
|
||||
|
||||
ENV JAVA_HOME=/usr/lib/jvm/default-jvm
|
||||
ENV PATH=$JAVA_HOME/bin:$PATH
|
||||
|
||||
# Install Python
|
||||
RUN apk add --no-cache python3-dev py3-pip \
|
||||
py3-setuptools py3-wheel
|
||||
RUN apk add --no-cache openssl python3-dev py3-pip py3-wheel py3-numpy py3-pandas
|
||||
RUN python3 -m pip install --break-system-package absl-py mypy-protobuf
|
||||
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
@@ -19,23 +20,13 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
|
||||
# --javabase=@local_jdk_11//:jdk \
|
||||
# --host_javabase=@local_jdk_11//:jdk \
|
||||
|
||||
# --javabase=@bazel_tools//tools/jdk:local_jdk11 \
|
||||
# --host_javabase=@bazel_tools//tools/jdk:local_jdk11 \
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--java_language_version=11 \
|
||||
--java_runtime_version=local_jdk11 \
|
||||
--tool_java_runtime_version=local_jdk11 \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
--host_javabase=@local_jdk//:jdk \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://hub.docker.com/_/archlinux/
|
||||
FROM archlinux:latest AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
RUN pacman -Syu --noconfirm git wget base-devel
|
||||
|
||||
# Install Bazelisk
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
|
||||
# Java
|
||||
RUN pacman -Syu --noconfirm jdk11-openjdk
|
||||
ENV JAVA_HOME=/usr/lib/jvm/default
|
||||
ENV PATH=${JAVA_HOME}/bin:$PATH
|
||||
RUN pacman -Syu --noconfirm git base-devel bazel
|
||||
|
||||
# Install Python
|
||||
RUN pacman -Syu --noconfirm python python-pip python-setuptools
|
||||
|
||||
@@ -1,32 +1,23 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://hub.docker.com/_/debian
|
||||
FROM debian:latest AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq git wget curl libssl-dev build-essential \
|
||||
&& apt-get install -yq python3-dev python3-pip python3-venv \
|
||||
&& apt-get install -yq default-jdk \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
# Install Bazel
|
||||
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
|
||||
RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
||||
ARG TARGETARCH=amd64
|
||||
RUN echo "deb [arch=$TARGETARCH] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq bazel \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Java
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq default-jdk \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Python
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq python3-dev python3-pip python3-venv \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
COPY . .
|
||||
|
||||
@@ -14,7 +14,7 @@ RUN dnf -y update \
|
||||
|
||||
# Install Bazelisk
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
|
||||
|
||||
@@ -11,17 +11,10 @@ ENV CC=gcc CXX=g++
|
||||
|
||||
# Install Bazelisk
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
|
||||
# Java
|
||||
RUN zypper install -y java-11-openjdk-devel \
|
||||
&& zypper clean -a
|
||||
|
||||
ENV JAVA_HOME=/usr/lib64/jvm/java
|
||||
ENV PATH=$JAVA_HOME/bin:$PATH
|
||||
|
||||
# Install Python
|
||||
RUN zypper update -y \
|
||||
&& zypper install -y python3 python3-pip python3-devel \
|
||||
|
||||
@@ -1,35 +1,37 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://quay.io/repository/centos/centos
|
||||
FROM quay.io/centos/centos:stream AS env
|
||||
# ref: https://hub.docker.com/_/rockylinux
|
||||
FROM rockylinux:9 AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install git wget gcc-toolset-11 \
|
||||
&& dnf -y install git wget zlib-devel gcc-toolset-13 \
|
||||
&& dnf -y groupinstall "Development Tools" \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/dnf
|
||||
|
||||
RUN echo "source /opt/rh/gcc-toolset-11/enable" >> /etc/bashrc
|
||||
RUN echo "source /opt/rh/gcc-toolset-13/enable" >> /etc/bashrc
|
||||
SHELL ["/bin/bash", "--login", "-c"]
|
||||
|
||||
# Install Bazelisk
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
|
||||
# Install Java
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel maven \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/dnf
|
||||
&& dnf -y install java-11-openjdk java-11-openjdk-devel maven \
|
||||
&& dnf clean all
|
||||
ENV JAVA_HOME=/usr/lib/jvm/java-openjdk
|
||||
|
||||
# Install Python
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install python3.11-devel \
|
||||
&& dnf -y install python3-devel python3-pip \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/dnf
|
||||
|
||||
# Add the library src to our build env
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
COPY . .
|
||||
@@ -1,6 +1,7 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://hub.docker.com/_/ubuntu
|
||||
FROM ubuntu:rolling AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV TZ=Europe/Paris
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
@@ -8,29 +9,20 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
# Install system build dependencies
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq git wget curl libssl-dev build-essential \
|
||||
&& apt-get install -yq python3-dev python3-pip python3-venv \
|
||||
&& apt-get install -yq default-jdk \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Bazel
|
||||
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
|
||||
RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
||||
ARG TARGETARCH=amd64
|
||||
RUN echo "deb [arch=$TARGETARCH] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq bazel \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Java
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq default-jdk \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Python
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq python3-dev python3-pip \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user