From 4e702656eaf79a269322799e97c4178853cac18c Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Fri, 8 Nov 2024 14:36:05 -0400 Subject: [PATCH] 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 --- .rhdh/docker/Dockerfile | 9 +++------ docker/Dockerfile | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.rhdh/docker/Dockerfile b/.rhdh/docker/Dockerfile index f6e75fd28..916ddc97c 100644 --- a/.rhdh/docker/Dockerfile +++ b/.rhdh/docker/Dockerfile @@ -46,8 +46,8 @@ WORKDIR $CONTAINER_SOURCE/ COPY $EXTERNAL_SOURCE_NESTED/.yarn ./.yarn COPY $EXTERNAL_SOURCE_NESTED/.yarnrc.yml ./ -# Add execute permissions to yarn -RUN chmod +x "$YARN" +# Add execute permissions to yarn; add yarn to path via symlink +RUN chmod +x "$YARN" && ln -s "$YARN" /usr/local/bin/yarn # Stage 2 - Install dependencies COPY $EXTERNAL_SOURCE_NESTED/yarn.lock ./ @@ -215,10 +215,7 @@ RUN \ # debug # ls -l /usr/; \ # set up node dir with common.gypi and unsafe-perms=true - ln -s /usr/include/node/common.gypi /usr/common.gypi; "$YARN" config set nodedir /usr; "$YARN" config set unsafe-perm true; \ - \ - # add yarn to path via symlink - ln -s "$CONTAINER_SOURCE"/"$YARN" /usr/local/bin/yarn + ln -s /usr/include/node/common.gypi /usr/common.gypi; "$YARN" config set nodedir /usr; "$YARN" config set unsafe-perm true # Downstream only - debug # RUN echo $PATH; ls -la /usr/local/bin/yarn; whereis yarn;which yarn; yarn --version; \ diff --git a/docker/Dockerfile b/docker/Dockerfile index 9b3d19243..8ccbc95cc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -46,8 +46,8 @@ WORKDIR $CONTAINER_SOURCE/ COPY $EXTERNAL_SOURCE_NESTED/.yarn ./.yarn COPY $EXTERNAL_SOURCE_NESTED/.yarnrc.yml ./ -# Add execute permissions to yarn -RUN chmod +x "$YARN" +# Add execute permissions to yarn; add yarn to path via symlink +RUN chmod +x "$YARN" && ln -s "$YARN" /usr/local/bin/yarn # Stage 2 - Install dependencies FROM skeleton AS deps