Skip to content

Commit 4e70265

Browse files
authored
chore(docker): ensure yarn is on the path so we can refer to it inside package.json files (#1913)
this fix is for downstream but might as well do the same for upstream for now to be consistent Signed-off-by: Nick Boldt <[email protected]>
1 parent cbcde8d commit 4e70265

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

.rhdh/docker/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ WORKDIR $CONTAINER_SOURCE/
4646
COPY $EXTERNAL_SOURCE_NESTED/.yarn ./.yarn
4747
COPY $EXTERNAL_SOURCE_NESTED/.yarnrc.yml ./
4848

49-
# Add execute permissions to yarn
50-
RUN chmod +x "$YARN"
49+
# Add execute permissions to yarn; add yarn to path via symlink
50+
RUN chmod +x "$YARN" && ln -s "$YARN" /usr/local/bin/yarn
5151

5252
# Stage 2 - Install dependencies
5353
COPY $EXTERNAL_SOURCE_NESTED/yarn.lock ./
@@ -215,10 +215,7 @@ RUN \
215215
# debug
216216
# ls -l /usr/; \
217217
# set up node dir with common.gypi and unsafe-perms=true
218-
ln -s /usr/include/node/common.gypi /usr/common.gypi; "$YARN" config set nodedir /usr; "$YARN" config set unsafe-perm true; \
219-
\
220-
# add yarn to path via symlink
221-
ln -s "$CONTAINER_SOURCE"/"$YARN" /usr/local/bin/yarn
218+
ln -s /usr/include/node/common.gypi /usr/common.gypi; "$YARN" config set nodedir /usr; "$YARN" config set unsafe-perm true
222219

223220
# Downstream only - debug
224221
# RUN echo $PATH; ls -la /usr/local/bin/yarn; whereis yarn;which yarn; yarn --version; \

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ WORKDIR $CONTAINER_SOURCE/
4646
COPY $EXTERNAL_SOURCE_NESTED/.yarn ./.yarn
4747
COPY $EXTERNAL_SOURCE_NESTED/.yarnrc.yml ./
4848

49-
# Add execute permissions to yarn
50-
RUN chmod +x "$YARN"
49+
# Add execute permissions to yarn; add yarn to path via symlink
50+
RUN chmod +x "$YARN" && ln -s "$YARN" /usr/local/bin/yarn
5151

5252
# Stage 2 - Install dependencies
5353
FROM skeleton AS deps

0 commit comments

Comments
 (0)