Merge pull request #489 from laradock/yarn

Support specific version of yarn.
This commit is contained in:
Bo-Yi Wu 2016-12-16 10:58:38 +08:00 committed by GitHub
commit 047e7f7cc3
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,7 @@ services:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
- NODE_VERSION=stable - NODE_VERSION=stable
- YARN_VERSION=latest
- TZ=UTC - TZ=UTC
volumes_from: volumes_from:
- applications - applications

View File

@ -189,10 +189,16 @@ USER laradock
ARG INSTALL_YARN=false ARG INSTALL_YARN=false
ENV INSTALL_YARN ${INSTALL_YARN} ENV INSTALL_YARN ${INSTALL_YARN}
ARG YARN_VERSION=latest
ENV YARN_VERSION ${YARN_VERSION}
RUN if [ ${INSTALL_YARN} = true ]; then \ RUN if [ ${INSTALL_YARN} = true ]; then \
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
curl -o- -L https://yarnpkg.com/install.sh | bash && \ if [ ${YARN_VERSION} = "latest" ]; then \
curl -o- -L https://yarnpkg.com/install.sh | bash; \
else \
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
fi && \
echo "" >> ~/.bashrc && \ echo "" >> ~/.bashrc && \
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
;fi ;fi