Skip to content

Commit 838d873

Browse files
author
Eyal Zekaria
committed
Symlink yarn directory
this will allow for an easier upgrade/downgrade of yarn, e.g: ``` FROM node:6-slim ENV YARN_VERSION 1.5.1 RUN curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" &&\ tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ &&\ ln -snf /opt/yarn-v$YARN_VERSION /opt/yarn &&\ rm yarn-v$YARN_VERSION.tar.gz ```
1 parent a27da9b commit 838d873

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Dockerfile-alpine.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
5858
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
5959
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
6060
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
61-
&& mkdir -p /opt/yarn \
62-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
61+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
62+
&& ln -s /opt/yarn-v$YARN_VERSION /opt/yarn \
6363
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
6464
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
6565
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \

Dockerfile-slim.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ RUN set -ex \
5858
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
5959
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
6060
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
61-
&& mkdir -p /opt/yarn \
62-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
61+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
62+
&& ln -s /opt/yarn-v$YARN_VERSION /opt/yarn \
6363
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
6464
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
6565
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz

Dockerfile-stretch.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ RUN set -ex \
5353
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
5454
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
5555
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
56-
&& mkdir -p /opt/yarn \
57-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
56+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
57+
&& ln -s /opt/yarn-v$YARN_VERSION /opt/yarn \
5858
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
5959
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
6060
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz

Dockerfile-wheezy.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ RUN set -ex \
4949
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
5050
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
5151
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
52-
&& mkdir -p /opt/yarn \
53-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
52+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
53+
&& ln -s /opt/yarn-v$YARN_VERSION /opt/yarn \
5454
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
5555
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
5656
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz

Dockerfile.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ RUN set -ex \
5353
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
5454
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
5555
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
56-
&& mkdir -p /opt/yarn \
57-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
56+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
57+
&& ln -s /opt/yarn-v$YARN_VERSION /opt/yarn \
5858
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
5959
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
6060
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz

0 commit comments

Comments
 (0)