update yarn dockerfile

This commit is contained in:
LingZhaoHui 2022-08-07 17:32:37 +08:00
parent 24260f8af5
commit f18e79aec9
3 changed files with 44 additions and 0 deletions

1
yarn/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node-v16.16.0-linux-x64

31
yarn/Dockerfile Normal file
View File

@ -0,0 +1,31 @@
FROM ubuntu:xenial
MAINTAINER lingzhaohui@zeekling.cn
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list && sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN mkdir -p /usr/src/app
ADD . /usr/src/app
WORKDIR /usr/src/app
RUN mv node-v16.16.0-linux-x64 /opt/node-v16.16.0
RUN echo NODE_HOME="/opt/node-v16.16.0" >> ~/.profile && echo PATH=$PATH:$NODE_HOME/bin >> ~/.profile
RUN export NODE_HOME="/opt/node-v16.16.0" && export PATH=$PATH:$NODE_HOME/bin && echo $PATH
RUN whereis node && ls /opt/node-v16.16.0/bin/node
RUN /opt/node-v16.16.0/bin/node -v
RUN /opt/node-v16.16.0/bin/npm -v
RUN /opt/node-v16.16.0/bin/npm install -g webpack
RUN /opt/node-v16.16.0/bin/npm install yarn
EXPOSE 4000
CMD ["yarn","bestart"]

12
yarn/build.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
rm -rf node-v16.16.0-linux-x64*
wget "https://repo.huaweicloud.com/nodejs/v16.16.0/node-v16.16.0-linux-x64.tar.xz"
tar xvf node-v16.16.0-linux-x64.tar.xz
rm -rf node-v16.16.0-linux-x64.tar.xz
sudo docker build -t "yarn:1.0" .