Skip to content
Open
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
5 changes: 5 additions & 0 deletions images/ubuntu-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ RUN find /tmp/scripts -name "*.sh" -type f -exec chmod +x {} \;
COPY scripts/entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh

RUN echo 'set -eo pipefail' >> /etc/bash.bashrc

RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo lsb-release jq dpkg && \
touch /run/.containerenv && \
/tmp/scripts/build/configure-apt-sources.sh && \
Expand Down Expand Up @@ -52,8 +54,11 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo lsb-release
/tmp/scripts/build/install-python.sh && \
/tmp/scripts/build/install-zstd.sh && \
/tmp/scripts/build/install-pipx-packages.sh && \
/tmp/scripts/build/install-docker-cli.sh && \
/tmp/scripts/build/configure-system.sh && \
/tmp/scripts/helpers/cleanup.sh

RUN sed -i '/set -eo pipefail/d' /etc/bash.bashrc

ENTRYPOINT ["/opt/entrypoint.sh"]

Expand Down
4 changes: 2 additions & 2 deletions images/ubuntu-slim/scripts/build/configure-apt-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ printf "https://archive.ubuntu.com/ubuntu/\tpriority:2\n" | tee -a /etc/apt/apt-
printf "https://security.ubuntu.com/ubuntu/\tpriority:3\n" | tee -a /etc/apt/apt-mirrors.txt

if is_ubuntu24; then
sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu/|mirror+file:/etc/apt/apt-mirrors.txt|' /etc/apt/sources.list.d/ubuntu.sources
sed -i 's|http://archive\.ubuntu\.com/ubuntu/|mirror+file:/etc/apt/apt-mirrors.txt|' /etc/apt/sources.list.d/ubuntu.sources
else
sed -i 's|http://azure\.archive\.ubuntu\.com/ubuntu/|mirror+file:/etc/apt/apt-mirrors.txt|' /etc/apt/sources.list
sed -i 's|http://archive\.ubuntu\.com/ubuntu/|mirror+file:/etc/apt/apt-mirrors.txt|' /etc/apt/sources.list
fi
5 changes: 0 additions & 5 deletions images/ubuntu-slim/scripts/build/configure-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ Acquire::https::No-Cache true;
Acquire::BrokenProxy true;
EOF

# Uninstall unattended-upgrades
apt-get purge unattended-upgrades

echo 'APT sources'
if ! is_ubuntu24; then
cat /etc/apt/sources.list
Expand All @@ -47,7 +44,5 @@ else
fi

apt-get update
# Install jq
apt-get install jq

echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
2 changes: 1 addition & 1 deletion images/ubuntu-slim/scripts/helpers/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ find /var/log/ -type f -exec cp /dev/null {} \;

rm -rf /tmp/downloads /tmp/installers

apt-get clean && rm -rf /var/lib/apt/lists/*
apt-get clean
3 changes: 3 additions & 0 deletions images/ubuntu-slim/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Usage: test.sh [IMAGE_NAME]
# If IMAGE_NAME is not provided, defaults to ubuntu-slim:test

set -o pipefail
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The 'set -eo pipefail' command is temporarily added to /etc/bash.bashrc during the build and then removed after all installation scripts complete. However, the test.sh file uses 'set -o pipefail' (without the 'e' flag). For consistency, consider using the same flags in both places, or document why different flags are used. The 'e' flag causes the shell to exit on any error, which may be desired during the build but not necessarily in the test script.

Suggested change
set -o pipefail
set -eo pipefail

Copilot uses AI. Check for mistakes.

show_help() {
echo "Usage: $0 [IMAGE_NAME]"
echo ""
Expand Down Expand Up @@ -91,6 +93,7 @@ run_test "zstd is installed" zstd --version
run_test "google cloud SDK is installed" gcloud --version
run_test "git lfs is installed" git lfs version
run_test "powershell is installed" pwsh --version
run_test "docker-cli is installed" docker --version
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The test for docker-cli is added here, but the corresponding installation script (install-docker-cli.sh) referenced in the Dockerfile does not exist in the repository. This test will fail until the installation script is added.

Suggested change
run_test "docker-cli is installed" docker --version
# NOTE: docker-cli is not currently installed by this image; re-enable this test
# once the corresponding installation script is added to the build.
# run_test "docker-cli is installed" docker --version

Copilot uses AI. Check for mistakes.

# Quick check: ensure the imagedata JSON file was created during image build
run_test "imagedata JSON file exists" test -f /imagegeneration/imagedata.json
Loading