Skip to content

Commit 39bd639

Browse files
consolidate all apt-get commands into single retry block
Combines apt-get update, software-properties-common install, PPA setup, and main package install into one retry loop. This protects all network operations from transient 403 errors on ARM64 mirrors. Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent 0824123 commit 39bd639

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Dockerfile.Node22fips

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ FROM ubuntu:22.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
7+
# Combine update, PPA setup, and install into one robust retry loop
118
RUN set -e; \
129
for i in 1 2 3 4 5; do \
13-
echo "Attempt $i: Updating and installing..."; \
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 && \
1414
apt-get update --allow-releaseinfo-change && \
1515
apt-get install -y --no-install-recommends --fix-missing \
1616
build-essential \
@@ -33,7 +33,7 @@ RUN set -e; \
3333
unzip \
3434
vim \
3535
&& break || \
36-
echo "Attempt $i failed! Waiting 15 seconds..." && sleep 15; \
36+
(echo "Attempt $i failed! Sleeping 15s..." && sleep 15); \
3737
done
3838
RUN rm -rf /var/lib/apt/lists/*
3939

0 commit comments

Comments
 (0)