Skip to content

Commit c799222

Browse files
nnobelissschuberth
authored andcommitted
feat(docker): Add Conan 2 to the Docker image
This command is available under the name 'conan2'. Signed-off-by: Nicolas Nobelis <[email protected]>
1 parent 7637e0f commit c799222

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,13 @@ ARG PYTHON_VERSION
136136
ARG PYENV_GIT_TAG
137137

138138
ENV PYENV_ROOT=/opt/python
139-
ENV PATH=$PATH:$PYENV_ROOT/shims:$PYENV_ROOT/bin
139+
ENV PATH=$PATH:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PYENV_ROOT/conan2/bin
140140
RUN curl -kSs https://pyenv.run | bash \
141141
&& pyenv install -v $PYTHON_VERSION \
142142
&& pyenv global $PYTHON_VERSION
143143

144144
ARG CONAN_VERSION
145+
ARG CONAN2_VERSION
145146
ARG PYTHON_INSPECTOR_VERSION
146147
ARG PYTHON_PIPENV_VERSION
147148
ARG PYTHON_POETRY_VERSION
@@ -175,6 +176,12 @@ RUN pip install --no-cache-dir -U \
175176
poetry-plugin-export=="$PYTHON_POETRY_PLUGIN_EXPORT_VERSION" \
176177
python-inspector=="$PYTHON_INSPECTOR_VERSION" \
177178
setuptools=="$PYTHON_SETUPTOOLS_VERSION"
179+
RUN mkdir /tmp/conan2 && cd /tmp/conan2 \
180+
&& wget https://github.com/conan-io/conan/releases/download/$CONAN2_VERSION/conan-$CONAN2_VERSION-linux-x86_64.tgz \
181+
&& tar -xvf conan-$CONAN2_VERSION-linux-x86_64.tgz\
182+
# Rename the Conan 2 executable to "conan2" to be able to call both Conan version from the package manager.
183+
&& mkdir $PYENV_ROOT/conan2 && mv /tmp/conan2/bin $PYENV_ROOT/conan2/ \
184+
&& mv $PYENV_ROOT/conan2/bin/conan $PYENV_ROOT/conan2/bin/conan2
178185

179186
FROM scratch AS python
180187
COPY --from=pythonbuild /opt/python /opt/python
@@ -477,7 +484,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
477484

478485
# Python
479486
ENV PYENV_ROOT=/opt/python
480-
ENV PATH=$PATH:$PYENV_ROOT/shims:$PYENV_ROOT/bin
487+
ENV PATH=$PATH:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PYENV_ROOT/conan2/bin
481488
COPY --from=python --chown=$USER:$USER $PYENV_ROOT $PYENV_ROOT
482489

483490
# NodeJS

docker/versions.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ARG BOYTERLC_VERSION=1.3.1
66
ARG COCOAPODS_VERSION=1.16.2
77
ARG COMPOSER_VERSION=2.8.4
88
ARG CONAN_VERSION=1.66.0
9+
ARG CONAN2_VERSION=2.14.0
910
ARG DART_VERSION=2.18.4
1011
ARG DOTNET_VERSION=6.0
1112
ARG GO_VERSION=1.24.0

scripts/docker_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ image_build base ort/base "${JAVA_VERSION}-jdk-${UBUNTU_VERSION}" \
6565
image_build python ort/python "$PYTHON_VERSION" \
6666
--build-arg PYTHON_VERSION="$PYTHON_VERSION" \
6767
--build-arg CONAN_VERSION="$CONAN_VERSION" \
68+
--build-arg CONAN2_VERSION="$CONAN2_VERSION" \
6869
--build-arg PYTHON_INSPECTOR_VERSION="$PYTHON_INSPECTOR_VERSION" \
6970
--build-arg PYTHON_PIPENV_VERSION="$PYTHON_PIPENV_VERSION" \
7071
--build-arg PYTHON_POETRY_VERSION="$PYTHON_POETRY_VERSION" \

0 commit comments

Comments
 (0)