Skip to content

Commit 18a6979

Browse files
add robust retry logic to regular Node Dockerfile
Same retry pattern as FIPS Dockerfile - consolidates all apt-get commands into single retry loop to handle transient mirror failures. Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent 39bd639 commit 18a6979

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

Dockerfile.Node22

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,37 @@ FROM ubuntu:20.04 AS base
44
# Set non-interactive mode to avoid prompts during installation
55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
# Install necessary dependencies
8-
RUN apt-get update
9-
RUN apt-get install -y software-properties-common
10-
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
11-
RUN apt-get update && apt-get install -y build-essential python3 python3-distutils g++-10 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim
7+
# Combine update, PPA setup, and install into one robust retry loop
8+
RUN set -e; \
9+
for i in 1 2 3 4 5; do \
10+
echo "Attempt $i: Setting up build environment..." && \
11+
apt-get update --allow-releaseinfo-change && \
12+
apt-get install -y --no-install-recommends software-properties-common && \
13+
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
14+
apt-get update --allow-releaseinfo-change && \
15+
apt-get install -y --no-install-recommends --fix-missing \
16+
build-essential \
17+
python3 \
18+
python3-distutils \
19+
g++-10 \
20+
make \
21+
curl \
22+
git \
23+
pkg-config \
24+
libssl-dev \
25+
libffi-dev \
26+
libgmp-dev \
27+
libtool \
28+
autoconf \
29+
automake \
30+
cmake \
31+
wget \
32+
xz-utils \
33+
unzip \
34+
vim \
35+
&& break || \
36+
(echo "Attempt $i failed! Sleeping 15s..." && sleep 15); \
37+
done
1238
RUN rm -rf /var/lib/apt/lists/*
1339

1440
# Set g++ 10 as the default

0 commit comments

Comments
 (0)