Skip to content

Update Dockerfile for Python 3.10 and dependencies#497

Open
omaralvarez wants to merge 1 commit intocvg:masterfrom
omaralvarez:fix_dockerfile
Open

Update Dockerfile for Python 3.10 and dependencies#497
omaralvarez wants to merge 1 commit intocvg:masterfrom
omaralvarez:fix_dockerfile

Conversation

@omaralvarez
Copy link
Copy Markdown

I tested the Dockerfile recently and it was not working with the current colmap image.

  • Updated to Python 3.10 to avoid errors (This script does not work on Python 3.8. The minimum supported Python version is 3.10. Please use https://bootstrap.pypa.io/pip/3.8/get-pip.py instead.). Also for LoMa Add LoMa #495 it is needed.
  • I have updated the MAINTAINER line because it is now deprecated and LABEL needs to be used.
  • Combined apt update and get to save on layers.
  • I added git to the dependencies since it was mising.
  • Used an absolute path in the WORKDIR since it is good practice.

Updated Python version to 3.10 and improved package installation.
Copilot AI review requested due to automatic review settings April 30, 2026 07:28
@omaralvarez omaralvarez mentioned this pull request Apr 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the project Dockerfile to build successfully against the current colmap/colmap base image by moving to a newer Python version and adjusting a few Dockerfile best-practices.

Changes:

  • Switch Python from 3.8 to 3.10 (via deadsnakes PPA) to restore get-pip.py compatibility and support newer components (e.g., LoMa work).
  • Replace deprecated MAINTAINER with a LABEL and add git to apt dependencies.
  • Use an absolute WORKDIR (/app) and combine apt-get update + apt-get install to reduce layers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
Comment on lines +5 to 8
apt-get install -y git unzip wget software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get -y update && \
apt-get install -y python${PYTHON_VERSION}
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

Consider adding --no-install-recommends and cleaning up apt metadata in the same RUN (e.g., removing /var/lib/apt/lists/* after install). Without this, the image retains apt cache data, increasing final image size and slowing pulls/builds.

Suggested change
apt-get install -y git unzip wget software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get -y update && \
apt-get install -y python${PYTHON_VERSION}
apt-get install -y --no-install-recommends git unzip wget software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get -y update && \
apt-get install -y --no-install-recommends python${PYTHON_VERSION} && \
rm -rf /var/lib/apt/lists/*

Copilot uses AI. Check for mistakes.
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.

2 participants