diff --git a/yarn/.gitignore b/yarn/.gitignore new file mode 100644 index 0000000..0e43993 --- /dev/null +++ b/yarn/.gitignore @@ -0,0 +1 @@ +node-v16.16.0-linux-x64 diff --git a/yarn/Dockerfile b/yarn/Dockerfile new file mode 100644 index 0000000..50b182d --- /dev/null +++ b/yarn/Dockerfile @@ -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"] + diff --git a/yarn/build.sh b/yarn/build.sh new file mode 100755 index 0000000..88e9dde --- /dev/null +++ b/yarn/build.sh @@ -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" . +