Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update base image #53

Merged
merged 11 commits into from
Jun 9, 2024
Merged

feat: Update base image #53

merged 11 commits into from
Jun 9, 2024

Conversation

Tiryoh
Copy link
Owner

@Tiryoh Tiryoh commented Jun 4, 2024

Summary by CodeRabbit

  • New Features

    • Introduced GitHub Actions workflows for deploying and testing on ROS Melodic and Noetic distributions.
    • Enhanced Dockerfiles for Melodic and Noetic with updated base images and additional software packages.
    • Added scripts to configure user environments and VNC settings for both ROS distributions.
  • Documentation

    • Updated README to reflect the new base image for the Docker setup.

Copy link

coderabbitai bot commented Jun 4, 2024

Warning

Review failed

The pull request is closed.

Walkthrough

The project has introduced and updated several GitHub Actions workflows for building, testing, and deploying ROS distributions (Melodic and Noetic). Additionally, Dockerfiles for both distributions have been significantly modified to update base images, install necessary packages, and configure environments. The entrypoint.sh scripts have been enhanced to set up the user environment and VNC configurations. Finally, the README has been updated to reflect changes in the base image references.

Changes

File(s) Change Summary
.github/workflows/deploy-melodic.yml New workflow for deploying to the Melodic ROS distribution.
.github/workflows/deploy-noetic.yml New workflow for deploying to the Noetic ROS distribution.
.github/workflows/test-melodic.yml New workflow for building and testing on the Melodic ROS distribution.
.github/workflows/test-noetic.yml New workflow for building and testing on the Noetic ROS distribution.
melodic/Dockerfile Updated base image, added packages, configured environments and settings for ROS Melodic.
melodic/entrypoint.sh Set up user environment, VNC settings, ROS environment variables, and desktop shortcuts.
noetic/Dockerfile Updated base image, added packages, configured environments and settings for ROS Noetic.
noetic/entrypoint.sh Set up user environment, VNC settings, ROS environment variables, and desktop shortcuts.
README.md Updated base image reference for the Docker image.

Poem

In a world of code and dreams so bright,
Workflows dance in the digital night.
Dockerfiles hum with a new-found grace,
Melodic and Noetic, they find their place.
From VNC to ROS, a seamless flight,
CodeRabbit's touch makes everything right.
🎶🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot]

This comment was marked as outdated.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a6642b9 and 2752fde.

Files selected for processing (2)
  • melodic/Dockerfile (1 hunks)
  • noetic/Dockerfile (1 hunks)
Files not reviewed due to errors (1)
  • melodic/Dockerfile (no review received)
Additional context used
Hadolint
noetic/Dockerfile

[warning] 33-33: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 33-33: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 41-41: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 41-41: Avoid additional packages by specifying --no-install-recommends (DL3015)


[info] 53-53: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 54-54: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 57-57: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 60-60: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 61-61: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 64-64: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 64-64: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[warning] 76-76: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[warning] 76-76: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 76-76: Avoid additional packages by specifying --no-install-recommends (DL3015)


[info] 76-76: Avoid use of wget without progress bar. Use wget --progress=dot:giga <url>. Or consider using -q or -nv (shorthands for --quiet or --no-verbose). (DL3047)


[warning] 91-91: Either use Wget or Curl but not both (DL4001)


[info] 91-91: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 91-91: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[warning] 91-91: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 111-111: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 111-111: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)

melodic/Dockerfile

[warning] 37-37: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 37-37: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 45-45: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 45-45: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 61-61: Pin versions in pip. Instead of pip install <package> use pip install <package>==<version> or pip install --requirement <requirements file> (DL3013)


[info] 67-67: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 68-68: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 71-71: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 74-74: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 75-75: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 78-78: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 78-78: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 91-91: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 104-104: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 104-104: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 104-104: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[info] 120-120: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 120-120: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)

Additional comments not posted (4)
noetic/Dockerfile (4)

18-18: Update to ubuntu:focal-20240427 base image is noted.


23-23: Setting the default shell to bash is a good practice for script compatibility.


111-117: Conditional installation for amd64 architecture is handled correctly.

Tools
Hadolint

[info] 111-111: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 111-111: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


20-20: Ensure TARGETPLATFORM is used appropriately in multi-platform builds.

Verification successful

The TARGETPLATFORM argument is used in the noetic/Dockerfile as follows:

  • Defined with ARG TARGETPLATFORM.
  • Used in a RUN command to check if the platform is linux/amd64.

This indicates that TARGETPLATFORM is being utilized appropriately for multi-platform builds.

  • noetic/Dockerfile:
    • ARG TARGETPLATFORM
    • RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify usage of TARGETPLATFORM in Dockerfile.

# Test: Search for TARGETPLATFORM usage. Expect: Proper usage in multi-platform specific commands.
rg --type dockerfile $'TARGETPLATFORM' noetic/Dockerfile

Length of output: 90



Script:

#!/bin/bash
# Description: Verify usage of TARGETPLATFORM in Dockerfile.

# Test: Search for TARGETPLATFORM usage. Expect: Proper usage in multi-platform specific commands.
rg --type Dockerfile 'TARGETPLATFORM' noetic/Dockerfile

Length of output: 90



Script:

#!/bin/bash
# Description: Verify usage of TARGETPLATFORM in Dockerfile.

# Test: Search for TARGETPLATFORM usage. Expect: Proper usage in multi-platform specific commands.
rg 'TARGETPLATFORM' noetic/Dockerfile

Length of output: 109

Comment on lines +26 to +30
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Consider reducing the number of layers by combining apt-get update and apt-get install commands.

- RUN apt-get update -q && \
-    DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
-    apt-get autoclean && \
-    apt-get autoremove && \
-    rm -rf /var/lib/apt/lists/*
+ RUN apt-get update -q && \
+    DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && apt-get autoclean && apt-get autoremove && \
+    rm -rf /var/lib/apt/lists/*
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && apt-get autoclean && apt-get autoremove && \
rm -rf /var/lib/apt/lists/*

fi

# Enable apt-get completion after running `apt-get update` in the container
RUN rm /etc/apt/apt.conf.d/docker-clean
Copy link

Choose a reason for hiding this comment

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

Remove unnecessary apt-get update calls to optimize build time and reduce network usage.

- RUN apt-get update -q && apt-get install -y ros-${ROS_DISTRO}-gazebo-ros-pkgs && rm -rf /var/lib/apt/lists/*
+ RUN apt-get install -y ros-${ROS_DISTRO}-gazebo-ros-pkgs && rm -rf /var_lib/apt/lists/*

Committable suggestion was skipped due to low confidence.

Comment on lines +32 to +37
# Install Ubuntu Mate desktop
RUN apt-get update -q && \
apt-get upgrade -yq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq wget curl git build-essential vim sudo lsb-release locales bash-completion tzdata gosu && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ubuntu-mate-desktop && \
apt-get autoclean && \
apt-get autoremove && \
Copy link

Choose a reason for hiding this comment

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

Pin versions of critical packages to ensure reproducibility.

- RUN apt-get update -q && \
-    DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-mate-desktop && \
-    apt-get autoclean && \
-    apt-get autoremove && \
-    rm -rf /var/lib/apt/lists/*
+ RUN apt-get update -q && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-mate-desktop=<version> && \
+    apt-get autoclean && \
+    apt-get autoremove && \
+    rm -rf /var/lib/apt/lists/*

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[warning] 33-33: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 33-33: Avoid additional packages by specifying --no-install-recommends (DL3015)

Comment on lines +76 to +84
RUN wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
-O /usr/share/keyrings/vscodium-archive-keyring.asc && \
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| tee /etc/apt/sources.list.d/vscodium.list && \
apt-get update -q && \
apt-get install -y codium && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Use wget --progress=dot:giga for better progress visibility during downloads.

- wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc
+ wget --progress=dot:giga https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
-O /usr/share/keyrings/vscodium-archive-keyring.asc && \
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| tee /etc/apt/sources.list.d/vscodium.list && \
apt-get update -q && \
apt-get install -y codium && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
RUN wget --progress=dot:giga https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
-O /usr/share/keyrings/vscodium-archive-keyring.asc && \
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| tee /etc/apt/sources.list.d/vscodium.list && \
apt-get update -q && \
apt-get install -y codium && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Tools
Hadolint

[warning] 76-76: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[warning] 76-76: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 76-76: Avoid additional packages by specifying --no-install-recommends (DL3015)


[info] 76-76: Avoid use of wget without progress bar. Use wget --progress=dot:giga <url>. Or consider using -q or -nv (shorthands for --quiet or --no-verbose). (DL3047)

Comment on lines +57 to +61
RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js

# Disable auto update and crash report
RUN sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades
RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
Copy link

Choose a reason for hiding this comment

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

Optimize sed commands by combining them into a single RUN instruction.

- RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js
- RUN sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades
- RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
+ RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr_lib/novnc/app/ui.js && \
+     sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades && \
+     sed -i 's/enabled=1/enabled=0/g' /etc/default/apport

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[info] 57-57: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 60-60: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 61-61: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)

Comment on lines +52 to +54
RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
RUN pip install --no-cache-dir git+https://github.com/novnc/websockify.git@v0.10.0
RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
Copy link

Choose a reason for hiding this comment

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

Combine RUN instructions related to noVNC and Websockify to optimize Docker layers.

- RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
- RUN pip install --no-cache-dir git+https://github.com/novnc/websockify.git@v0.10.0
- RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
+ RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc && \
+     pip install --no-cache-dir git+https://github.com/novnc/websockify.git@v0.10.0 && \
+     ln -s /usr/lib/novnc/vnc.html /usr_lib/novnc/index.html

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[info] 53-53: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)


[info] 54-54: Multiple consecutive RUN instructions. Consider consolidation. (DL3059)

Comment on lines +41 to +49
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
tigervnc-standalone-server tigervnc-common \
supervisor wget curl gosu git sudo python3-pip tini \
build-essential vim sudo lsb-release locales \
bash-completion tzdata terminator && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Consolidate RUN instructions to reduce layers and improve build efficiency.

- RUN apt-get update && \
-    DEBIAN_FRONTEND=noninteractive apt-get install -y \
-        tigervnc-standalone-server tigervnc-common \
-        supervisor wget curl gosu git sudo python3-pip tini \
-        build-essential vim sudo lsb-release locales \
-        bash-completion tzdata terminator && \
-    apt-get autoclean && \
-    apt-get autoremove && \
-    rm -rf /var/lib/apt/lists/*
+ RUN apt-get update && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y tigervnc-standalone-server tigervnc-common supervisor wget curl gosu git sudo python3-pip tini build-essential vim sudo lsb-release locales bash-completion tzdata terminator && \
+    apt-get autoclean && \
+    apt-get autoremove && \
+    rm -rf /var_lib/apt/lists/*

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[warning] 41-41: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 41-41: Avoid additional packages by specifying --no-install-recommends (DL3015)

Comment on lines +91 to +105
RUN apt-get update -q && \
apt-get install -y curl gnupg2 lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
python3-catkin-tools \
python3-osrf-pycommon \
python3-argcomplete \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Ensure all package versions are pinned to avoid potential incompatibilities.

- RUN apt-get update -q && \
-    apt-get install -y curl gnupg2 lsb-release && \
-    curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
-    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null && \
-    apt-get update -q && \
-    apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
-    python3-rosinstall \
-    python3-rosinstall-generator \
-    python3-wstool \
-    python3-catkin-tools \
-    python3-osrf-pycommon \
-    python3-argcomplete \
-    python3-rosdep python3-vcstool && \
-    rosdep init && \
-    rm -rf /var_lib/apt/lists/*
+ RUN apt-get update -q && \
+    apt-get install -y curl=<version> gnupg2=<version> lsb-release=<version> && \
+    curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
+    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null && \
+    apt-get update -q && \
+    apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE}=<version> \
+    python3-rosinstall=<version> \
+    python3-rosinstall-generator=<version> \
+    python3-wstool=<version> \
+    python3-catkin-tools=<version> \
+    python3-osrf-pycommon=<version> \
+    python3-argcomplete=<version> \
+    python3-rosdep=<version> python3-vcstool=<version> && \
+    rosdep init && \
+    rm -rf /var_lib/apt/lists/*
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN apt-get update -q && \
apt-get install -y curl gnupg2 lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
python3-catkin-tools \
python3-osrf-pycommon \
python3-argcomplete \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update -q && \
apt-get install -y curl=<version> gnupg2=<version> lsb-release=<version> && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE}=<version> \
python3-rosinstall=<version> \
python3-rosinstall-generator=<version> \
python3-wstool=<version> \
python3-catkin-tools=<version> \
python3-osrf-pycommon=<version> \
python3-argcomplete=<version> \
python3-rosdep=<version> python3-vcstool=<version> && \
rosdep init && \
rm -rf /var_lib/apt/lists/*
Tools
Hadolint

[warning] 91-91: Either use Wget or Curl but not both (DL4001)


[info] 91-91: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 91-91: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[warning] 91-91: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)

Comment on lines +64 to +72
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:mozillateam/ppa -y && \
echo 'Package: *' > /etc/apt/preferences.d/mozilla-firefox && \
echo 'Pin: release o=LP-PPA-mozillateam' >> /etc/apt/preferences.d/mozilla-firefox && \
echo 'Pin-Priority: 1001' >> /etc/apt/preferences.d/mozilla-firefox && \
apt-get update -q && \
apt-get install -y --allow-downgrades \
firefox && \
apt-get autoclean && \
apt-get autoremove && \
Copy link

Choose a reason for hiding this comment

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

Ensure all package versions are pinned to avoid potential incompatibilities.

- RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:mozillateam/ppa -y && \
-    echo 'Package: *' > /etc/apt/preferences.d/mozilla-firefox && \
-    echo 'Pin: release o=LP-PPA-mozillateam' >> /etc/apt/preferences.d/mozilla-firefox && \
-    echo 'Pin-Priority: 1001' >> /etc/apt/preferences.d/mozilla-firefox && \
-    apt-get update -q && \
-    apt-get install -y --allow-downgrades \
-    firefox && \
-    apt-get autoclean && \
-    apt-get autoremove && \
-    rm -rf /var/lib/apt/lists/*
+ RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:mozillateam/ppa -y && \
+    echo 'Package: *' > /etc/apt/preferences.d/mozilla-firefox && \
+    echo 'Pin: release o=LP-PPA-mozillateam' >> /etc/apt/preferences.d/mozilla-firefox && \
+    echo 'Pin-Priority: 1001' >> /etc/apt/preferences.d/mozilla-firefox && \
+    apt-get update -q && \
+    apt-get install -y --allow-downgrades firefox=<version> && \
+    apt-get autoclean && \
+    apt-get autoremove && \
+    rm -rf /var_lib/apt/lists/*

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[info] 64-64: Avoid additional packages by specifying --no-install-recommends (DL3015)


[warning] 64-64: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)

@Tiryoh Tiryoh merged commit 34c06b4 into master Jun 9, 2024
@Tiryoh Tiryoh deleted the feature/update-base-image branch June 9, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant