Skip to content

Commit 62e0f04

Browse files
committed
Support Yarn MANAGEMENT tool.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent a284731 commit 62e0f04

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
- INSTALL_XDEBUG=false
1212
- INSTALL_MONGO=false
1313
- INSTALL_NODE=false
14+
- INSTALL_YARN=false
1415
- INSTALL_DRUSH=false
1516
- INSTALL_AEROSPIKE_EXTENSION=false
1617
- COMPOSER_GLOBAL_INSTALL=false

workspace/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,30 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
181181
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
182182
;fi
183183

184+
#####################################
185+
# YARN:
186+
#####################################
187+
188+
USER laradock
189+
190+
ARG INSTALL_YARN=false
191+
ENV INSTALL_YARN ${INSTALL_YARN}
192+
193+
RUN if [ ${INSTALL_YARN} = true ]; then \
194+
curl -o- -L https://yarnpkg.com/install.sh | bash && \
195+
echo "" >> ~/.bashrc && \
196+
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
197+
;fi
198+
199+
# Add YARN binaries to root's .bashrc
200+
USER root
201+
202+
RUN if [ ${INSTALL_YARN} = true ]; then \
203+
echo "" >> ~/.bashrc && \
204+
echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \
205+
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \
206+
;fi
207+
184208
#####################################
185209
# PHP Aerospike:
186210
#####################################

0 commit comments

Comments
 (0)