Conversation
Tohrusky
commented
Sep 27, 2025
- cleanup to maximize build space
Summary of ChangesHello @Tohrusky, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request prepares for a new release by bumping the project's version to Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the version to v0.5.0 and refactors the worker-merge Dockerfile to reduce image layers. The version bump is appropriate for a release. The Dockerfile change is a good step, but I've identified a correctness issue with the mkvtoolnix installation and several opportunities for further optimization to better achieve the goal of maximizing build space. My review includes a detailed suggestion to address these points.
| RUN apt update -y && apt upgrade -y && \ | ||
| apt install -y wget && \ | ||
| wget -O /etc/apt/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg && \ | ||
| apt update -y && apt upgrade -y |
There was a problem hiding this comment.
While combining RUN instructions is a good step towards optimizing the Docker image, this can be improved further for correctness and efficiency. I'm using apt-get in my suggestion as it's generally recommended for scripting in Dockerfiles over apt.
- Correctness: To install
mkvtoolnixfrom themkvtoolnix.downloadrepository, you need to add its source to apt's sources list. This step is currently missing, which likely results in installing an older version from the default Debian repositories. - Efficiency: The
apt upgradecommands are often unnecessary, slow down the build, and increase image size. It's better to install specific packages from an up-to-date base image.
The suggestion below fixes these issues for the lines you've changed. For maximum benefit, you should also combine the RUN apt install -y mkvtoolnix command into this single RUN block and add cleanup steps at the end. A fully optimized command would look like this:
RUN apt-get update && \
apt-get install -y --no-install-recommends wget ca-certificates && \
wget -O /etc/apt/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/debian/ bookworm main" > /etc/apt/sources.list.d/mkvtoolnix.list && \
apt-get update && \
apt-get install -y --no-install-recommends mkvtoolnix && \
apt-get purge -y --auto-remove wget && \
rm -rf /var/lib/apt/lists/*Since I can only suggest changes to the modified lines, my suggestion below only covers the preparation steps.
RUN apt-get update && \
apt-get install -y --no-install-recommends wget ca-certificates && \
wget -O /etc/apt/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/debian/ bookworm main" > /etc/apt/sources.list.d/mkvtoolnix.list && \
apt-get update