Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 12 additions & 3 deletions containers/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ FROM ${BASE_IMAGE}

# Install required packages and Node.js 22
# Note: Some packages may already exist in runner-like base images, apt handles this gracefully
# Retry logic handles transient 404s when Ubuntu archive supersedes package versions mid-build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
( apt-get install -y --no-install-recommends \
iptables \
curl \
ca-certificates \
Expand All @@ -21,7 +22,13 @@ RUN apt-get update && \
net-tools \
netcat-openbsd \
gosu \
libcap2-bin && \
libcap2-bin || \
(echo "apt-get install failed, retrying with fresh package index..." && \
rm -rf /var/lib/apt/lists/* && \
apt-get update && \
apt-get install -y --no-install-recommends \
iptables curl ca-certificates git gh gnupg dnsutils \
net-tools netcat-openbsd gosu libcap2-bin) ) && \

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The retry path repeats the full package list, which can drift from the primary install list above if it’s edited later. To avoid future inconsistencies, define the packages once (e.g., in a shell variable) and use that in both the initial install and the retry.

This issue also appears on line 80 of the same file.

Copilot uses AI. Check for mistakes.
# Prefer system binaries over runner toolcache (e.g., act images) for Node checks.
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" && \
# Install Node.js 22 from NodeSource
Expand Down Expand Up @@ -70,7 +77,9 @@ RUN chmod +x /usr/local/bin/setup-iptables.sh /usr/local/bin/entrypoint.sh /usr/
# This prevents tokens from being read multiple times (e.g., by malicious code)
COPY one-shot-token/one-shot-token.c /tmp/one-shot-token.c
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc libc6-dev && \
( apt-get install -y --no-install-recommends gcc libc6-dev || \
(rm -rf /var/lib/apt/lists/* && apt-get update && \
apt-get install -y --no-install-recommends gcc libc6-dev) ) && \
gcc -shared -fPIC -O2 -Wall -o /usr/local/lib/one-shot-token.so /tmp/one-shot-token.c -ldl -lpthread && \
rm /tmp/one-shot-token.c && \
apt-get remove -y gcc libc6-dev && \
Expand Down
8 changes: 6 additions & 2 deletions containers/squid/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM ubuntu/squid:latest

# Install additional tools for debugging, healthcheck, and SSL Bump
# Retry logic handles transient 404s when Ubuntu archive supersedes package versions mid-build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
( apt-get install -y --no-install-recommends \
curl \
dnsutils \
net-tools \
netcat-openbsd \
openssl \
squid-openssl && \
squid-openssl || \
(rm -rf /var/lib/apt/lists/* && apt-get update && \
apt-get install -y --no-install-recommends \
curl dnsutils net-tools netcat-openbsd openssl squid-openssl) ) && \

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package list is duplicated between the initial install and the retry install. This is easy to get out of sync over time (e.g., adding/removing a package requires updating two lists). Consider defining the package list once (e.g., a shell variable) and reusing it in both install attempts.

See below for a potential fix:

RUN set -eux; \
    PKGS="curl dnsutils net-tools netcat-openbsd openssl squid-openssl"; \
    apt-get update && \
    ( apt-get install -y --no-install-recommends $PKGS || \
      (rm -rf /var/lib/apt/lists/* && apt-get update && \
       apt-get install -y --no-install-recommends $PKGS) ) && \

Copilot uses AI. Check for mistakes.
rm -rf /var/lib/apt/lists/*

# Create log directory and SSL database directory
Expand Down
Loading