Skip to content
Merged
Changes from all commits
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
18 changes: 18 additions & 0 deletions release/ray_release/byod/byod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ APT_PKGS=(
libglfw3
libjemalloc-dev
libosmesa6-dev
lsb-release
patchelf
)

Expand All @@ -30,6 +31,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/*


sudo mkdir -p /etc/apt/keyrings
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

sudo chmod go+r /etc/apt/keyrings/microsoft.gpg

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