Skip to content

Commit

Permalink
chore(docker): ensure yarn is on the path so we can refer to it insid…
Browse files Browse the repository at this point in the history
…e 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 <nboldt@redhat.com>
  • Loading branch information
nickboldt authored Nov 8, 2024
1 parent cbcde8d commit 4e70265
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions .rhdh/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./
Expand Down Expand Up @@ -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; \
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e70265

Please sign in to comment.