Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile.art
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ RUN INSTALL_PKGS=" \
gcc-c++ \
git \
make \
unzip \
openssl-devel \
llvm-toolset \
rust-toolset-1.88.0 \
crypto-policies-scripts \
protobuf-compiler \
" && \
microdnf install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS
Expand All @@ -19,6 +19,7 @@ RUN update-crypto-policies --set DEFAULT:PQ
COPY . /opt/app-root/src
WORKDIR /opt/app-root/src

RUN scripts/environment/install-protoc.sh
RUN make build-offline

# Strip binary to reduce image size for DaemonSet deployment
Expand Down
21 changes: 17 additions & 4 deletions scripts/environment/install-protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ get_arch() {
echo "aarch_64"
elif [[ "${os}" == "Linux" && "${arch}" == "aarch64" ]]; then
echo "aarch_64"
elif [[ "${arch}" == "s390x" ]]; then
echo "s390_64"
elif [[ "${arch}" == "ppc64le" ]]; then
echo "ppcle_64"
else
echo "${arch}"
fi
Expand All @@ -52,12 +56,21 @@ install_protoc() {
local install_path=$2

local base_url="https://github.com/protocolbuffers/protobuf/releases/download"
local url
url="${base_url}/v${version}/protoc-${version}-$(get_platform)-$(get_arch).zip"
local filename
filename="protoc-${version}-$(get_platform)-$(get_arch).zip"
local download_path="${TMP_DIR}/protoc.zip"

echo "Downloading ${url}"
curl -fsSL "${url}" -o "${download_path}"
local cachi_file
cachi_file="/cachi2/output/deps/generic/${filename}"
if [ -e "${cachi_file}" ]; then
echo "Using ${filename} from cachi2"
cp "${cachi_file}" "${download_path}"
else
local url
url="${base_url}/v${version}/${filename}"
echo "Downloading ${url}"
curl -fsSL "${url}" -o "${download_path}"
fi

unzip -qq "${download_path}" -d "${TMP_DIR}"
mv -f -v "${TMP_DIR}/bin/protoc" "${install_path}"
Expand Down