Skip to content

Commit b814222

Browse files
committed
Support specific version of yarn.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent b62d9bc commit b814222

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
- PUID=1000
2929
- PGID=1000
3030
- NODE_VERSION=stable
31+
- YARN_VERSION=latest
3132
- TZ=UTC
3233
volumes_from:
3334
- applications

workspace/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,16 @@ USER laradock
189189

190190
ARG INSTALL_YARN=false
191191
ENV INSTALL_YARN ${INSTALL_YARN}
192+
ARG YARN_VERSION=latest
193+
ENV YARN_VERSION ${YARN_VERSION}
192194

193195
RUN if [ ${INSTALL_YARN} = true ]; then \
194196
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
195-
curl -o- -L https://yarnpkg.com/install.sh | bash && \
197+
if [ ${YARN_VERSION} = "latest" ]; then \
198+
curl -o- -L https://yarnpkg.com/install.sh | bash; \
199+
else \
200+
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
201+
fi && \
196202
echo "" >> ~/.bashrc && \
197203
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
198204
;fi

0 commit comments

Comments
 (0)