@@ -2,21 +2,24 @@ FROM ubuntu:14.04
2
2
3
3
MAINTAINER MagicVision Team
4
4
5
+ ENV NVM_VERSION v0.29.0
6
+ ENV NODEJS_VERSION v5.0.0
7
+
5
8
RUN apt-get update -y
6
9
7
10
# Add a normal user with sudo permission
8
11
RUN adduser --disabled-password --gecos "" ubuntu && echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu
9
12
10
13
# Install nvm
11
14
RUN apt-get install -y curl build-essential libssl-dev man && \
12
- curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1 /install.sh | su - ubuntu -c sh && \
15
+ curl https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION /install.sh | su - ubuntu -c sh && \
13
16
echo 'export NVM_DIR="$HOME/.nvm"' >> /etc/profile && \
14
17
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> /etc/profile
15
18
16
- # Install node.js 4.1.0
17
- RUN su - ubuntu -c "nvm install 4.1.0 " && \
18
- su - ubuntu -c "nvm alias default 4.1.0 " && \
19
- su - ubuntu -c "nvm use 4.1.0 "
19
+ # Install node.js
20
+ RUN su - ubuntu -c "nvm install $NODEJS_VERSION " && \
21
+ su - ubuntu -c "nvm alias default $NODEJS_VERSION " && \
22
+ su - ubuntu -c "nvm use $NODEJS_VERSION "
20
23
21
24
# Use Taobao node mirror and npm registry
22
25
ENV NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
@@ -55,6 +58,9 @@ RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted
55
58
echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
56
59
apt-get update -y
57
60
61
+ # Use 114 DNS
62
+ RUN echo "nameserver 114.114.114.114" > /etc/resolv.conf
63
+
58
64
# Create builds dir for CI
59
65
RUN mkdir /builds && chmod 777 /builds
60
66
0 commit comments