Skip to content

Commit

Permalink
update devcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Jul 18, 2024
1 parent 94c8d0c commit 720afd3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 16 deletions.
40 changes: 26 additions & 14 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM ubuntu:20.04

ARG QT_VERSION=5.15.2
ARG PYTHON_VERSION=3.11

ENV PATH=/opt/qt/${QT_VERSION}/gcc_64/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/qt/${QT_VERSION}/gcc_64/lib/:/workspaces/pymeshlab/pymeshlab/lib/
ENV QT_PLUGIN_PATH=/opt/qt/${QT_VERSION}/gcc_64/plugins/
ENV QML_IMPORT_PATH=/opt/qt/${QT_VERSION}/gcc_64/qml/
ENV QML2_IMPORT_PATH=/opt/qt/${QT_VERSION}/gcc_64/qml/

RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential \
fontconfig \
Expand All @@ -24,24 +33,28 @@ RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
libxerces-c-dev \
ninja-build \
patchelf \
# to be removed
python3 \
python3-pip \
&& pip3 install aqtinstall numpy
wget && \
pip3 install aqtinstall

ARG QT=5.15.2
ARG QT_HOST=linux
ARG QT_TARGET=desktop
RUN aqt install-qt -O /opt/qt ${QT_HOST} ${QT_TARGET} ${QT}
RUN aqt install-qt -O /opt/qt linux desktop ${QT_VERSION} && \
pip3 uninstall -y aqtinstall && \
apt-get -y remove python3-pip python3

ENV PATH=/opt/qt/${QT}/gcc_64/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/qt/${QT}/gcc_64/lib/:/workspaces/pymeshlab/pymeshlab/lib/
ENV QT_PLUGIN_PATH=/opt/qt/${QT}/gcc_64/plugins/
ENV QML_IMPORT_PATH=/opt/qt/${QT}/gcc_64/qml/
ENV QML2_IMPORT_PATH=/opt/qt/${QT}/gcc_64/qml/
# install python
RUN apt-get -y install software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa -y && apt-get -y update && \
apt-get -y install python${PYTHON_VERSION} python${PYTHON_VERSION}-dev && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 && \
wget https://bootstrap.pypa.io/get-pip.py && \
python${PYTHON_VERSION} get-pip.py && \
rm get-pip.py && \
pip install numpy

# install latest cmake and embree
RUN apt purge --auto-remove cmake && \
apt-get -y install wget && \
RUN apt-get -y purge --auto-remove cmake && \
wget -qO- "https://cmake.org/files/v3.19/cmake-3.19.2-Linux-x86_64.tar.gz" \
| tar --strip-components=1 -xz -C /usr/local &&\
wget -qO- "https://github.com/embree/embree/releases/download/v4.3.2/embree-4.3.2.x86_64.linux.tar.gz" \
Expand All @@ -50,8 +63,7 @@ RUN apt purge --auto-remove cmake && \
apt-get -y remove wget && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/* && \
pip3 uninstall -y aqtinstall
rm -rf /var/lib/apt/lists/*

# Generating a universally unique ID for the Container
RUN dbus-uuidgen > /etc/machine-id
7 changes: 7 additions & 0 deletions .devcontainer/build_wheel_3_12/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "PyMeshLab wheel for Python 3.12",
"dockerComposeFile": "../docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/pymeshlab",
// TODO
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PyMeshLab",
"dockerComposeFile": "docker-compose.yml",
"name": "Develop PyMeshLab",
"dockerComposeFile": "../docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/pymeshlab",

Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
- PYTHON_VERSION=3.12
stdin_open: true # docker run -i
tty: true # docker run -t
volumes:
Expand Down

0 comments on commit 720afd3

Please sign in to comment.