You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/BestPractices.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,12 +32,28 @@ ENV PATH=$PATH:/home/node/.npm-global/bin # optionally if you want to run npm gl
32
32
33
33
## Upgrading/downgrading Yarn
34
34
35
-
If you need to upgrade/downgrade `yarn`, you can do so by issuing the following commands in your `Dockerfile`:
35
+
### Local
36
+
37
+
If you need to upgrade/downgrade `yarn` for a local install, you can do so by issuing the following commands in your `Dockerfile`:
38
+
39
+
> Note that if you create some other directory which is not a descendant one from where you ran the command, you will end up using the global (dated) version. If you wish to upgrade `yarn` globally follow the instructions in the next section.
40
+
41
+
> When following the local install instructions, due to duplicated yarn the image will end up being bigger.
36
42
37
43
```Dockerfile
38
44
FROM node:6
39
45
40
-
ENV YARN_VERSION 1.5.1
46
+
ENV YARN_VERSION 1.16.0
47
+
48
+
RUN yarn policies set-version $YARN_VERSION
49
+
```
50
+
51
+
### Global
52
+
53
+
```Dockerfile
54
+
FROM node:6
55
+
56
+
ENV YARN_VERSION 1.16.0
41
57
42
58
RUN curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
0 commit comments