Skip to content
Merged
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
20 changes: 20 additions & 0 deletions release/ray_release/byod/byod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ set -euo pipefail
APT_PKGS=(
apt-transport-https
ca-certificates
curl
gnupg
Copy link
Collaborator

Choose a reason for hiding this comment

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

gnupg and curl are already inside the image. they do not need to be reinstalled here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed!

htop
libaio1
libgl1-mesa-glx
libglfw3
libjemalloc-dev
libosmesa6-dev
lsb-release
patchelf
)

Expand All @@ -30,6 +33,23 @@ sudo apt-get install -y --no-install-recommends "${APT_PKGS[@]}"
sudo apt-get autoclean
sudo rm -rf /etc/apt/sources.list.d/*
Comment on lines 31 to 32
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

After installing the Azure CLI, it's a good practice to clean up the APT package lists to reduce the image size. This can be done by adding sudo apt-get clean to the Dockerfile.

Also, consider combining the autoclean and rm commands into a single RUN instruction.

RUN sudo apt-get autoclean && sudo rm -rf /etc/apt/sources.list.d/*


mkdir -p /etc/apt/keyrings
Copy link

Choose a reason for hiding this comment

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

Bug: Missing sudo for /etc/ Directory Creation

The mkdir -p /etc/apt/keyrings command is missing sudo. Creating a directory in /etc/ requires root permissions, and the script consistently uses sudo for other privileged operations. This will likely cause a permission denied error.

Fix in Cursor Fix in Web

curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
Comment on lines +35 to +36
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

It's generally better to combine multiple commands into a single RUN instruction using && to reduce the number of layers in the Docker image. This can improve build speed and reduce image size.

Consider combining the curl and gpg commands into a single RUN instruction.

RUN curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null

chmod go+r /etc/apt/keyrings/microsoft.gpg
Copy link

Choose a reason for hiding this comment

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

Bug: Missing sudo for chmod on Root-Owned File

The chmod command for /etc/apt/keyrings/microsoft.gpg is missing sudo. Since the file is created by sudo tee, it's root-owned, and modifying its permissions without sudo will result in a permission denied error.

Fix in Cursor Fix in Web


AZ_VER=2.72.0
AZ_DIST="$(lsb_release -cs)"
echo "Types: deb
URIs: https://packages.microsoft.com/repos/azure-cli/
Suites: ${AZ_DIST}
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources

sudo apt-get update -y
sudo apt-get install -y azure-cli="${AZ_VER}"-1~"${AZ_DIST}"
Comment on lines +39 to +49
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider using ARG to define the Azure CLI version (AZ_VER) so that it can be easily overridden during the build process. This makes the Dockerfile more flexible and configurable.

Also, it would be better to combine all the commands related to setting up the Azure CLI repository and installing Azure CLI into a single RUN instruction to reduce the number of layers in the Docker image.

ARG AZ_VER=2.72.0
RUN AZ_DIST="$(lsb_release -cs)" && \
    echo "Types: deb\nURIs: https://packages.microsoft.com/repos/azure-cli/\nSuites: ${AZ_DIST}\nComponents: main\nArchitectures: $(dpkg --print-architecture)\nSigned-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources && \
    sudo apt-get update -y && \
    sudo apt-get install -y azure-cli="${AZ_VER}"-1~"${AZ_DIST}"


git clone --branch=4.2.0 --depth=1 https://github.com/wg/wrk.git /tmp/wrk
make -C /tmp/wrk -j
sudo cp /tmp/wrk/wrk /usr/local/bin/wrk
Expand Down