Skip to content

Commit 7ec0cd0

Browse files
committed
Set CONAN_HOME in every image with Conan installed
1 parent 182f371 commit 7ec0cd0

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

docker/debian/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ USER ${NONROOT_USER}
123123
ENV HOME=/home/${NONROOT_USER}
124124
WORKDIR ${HOME}
125125

126+
# Set Conan home directory, so the users of this image can find default profile
127+
ENV CONAN_HOME=${HOME}/.conan2
128+
126129
# Create a default Conan profile.
127130
RUN <<EOF
128131
conan profile detect
@@ -194,6 +197,9 @@ USER ${NONROOT_USER}
194197
ENV HOME=/home/${NONROOT_USER}
195198
WORKDIR ${HOME}
196199

200+
# Set Conan home directory, so the users of this image can find default profile
201+
ENV CONAN_HOME=${HOME}/.conan2
202+
197203
# Create a default Conan profile.
198204
RUN <<EOF
199205
conan profile detect

docker/rhel/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ USER ${NONROOT_USER}
8686
ENV HOME=/home/${NONROOT_USER}
8787
WORKDIR ${HOME}
8888

89-
# Fix the Conan user home directory as it otherwise will point to the
90-
# /opt/app-root/src/.conan2 directory.
91-
ENV CONAN_HOME=/home/${NONROOT_USER}/.conan2
89+
# Set Conan home directory, so the users of this image can find default profile
90+
ENV CONAN_HOME=${HOME}/.conan2
9291

9392
# Create a default Conan profile.
9493
RUN <<EOF
@@ -170,9 +169,8 @@ USER ${NONROOT_USER}
170169
ENV HOME=/home/${NONROOT_USER}
171170
WORKDIR ${HOME}
172171

173-
# Fix the Conan user home directory as it otherwise will point to the
174-
# /opt/app-root/src/.conan2 directory.
175-
ENV CONAN_HOME=/home/${NONROOT_USER}/.conan2
172+
# Set Conan home directory, so the users of this image can find default profile
173+
ENV CONAN_HOME=${HOME}/.conan2
176174

177175
# Create a default Conan profile.
178176
RUN <<EOF

docker/ubuntu/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ USER ${NONROOT_USER}
103103
ENV HOME=/home/${NONROOT_USER}
104104
WORKDIR ${HOME}
105105

106+
# Set Conan home directory, so the users of this image can find default profile
107+
ENV CONAN_HOME=${HOME}/.conan2
108+
106109
# Create a default Conan profile.
107110
RUN <<EOF
108111
conan profile detect
@@ -187,6 +190,9 @@ USER ${NONROOT_USER}
187190
ENV HOME=/home/${NONROOT_USER}
188191
WORKDIR ${HOME}
189192

193+
# Set Conan home directory, so the users of this image can find default profile
194+
ENV CONAN_HOME=${HOME}/.conan2
195+
190196
# Create a default Conan profile.
191197
RUN <<EOF
192198
conan profile detect

0 commit comments

Comments
 (0)