-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile-alpine
executable file
·70 lines (57 loc) · 2.87 KB
/
Dockerfile-alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM alpine:3.4
MAINTAINER soulteary <[email protected]>
ENV VERSION=v6.9.2 NPM_VERSION=3
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN echo '' > /etc/apk/repositories && \
echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main" >> /etc/apk/repositories && \
echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/community" >> /etc/apk/repositories && \
echo "166.111.206.63 mirror.tuna.tsinghua.edu.cn" >> /etc/hosts && \
echo "185.31.17.249 github.com" >> /etc/hosts && \
echo "104.20.22.46 nodejs.org" >> /etc/hosts && \
echo "Asia/Shanghai" > /etc/timezone
RUN apk --no-cache --no-progress update && \
apk --no-cache --no-progress upgrade
RUN apk add bash \
&& sed -i -e "s/bin\/ash/bin\/bash/" /etc/passwd
RUN apk add openssh git
RUN apk add --no-cache curl make gcc g++ python linux-headers paxctl libgcc libstdc++ gnupg && \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
9554F04D7259F04124DE6B476D5A82AC7E37093B \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
B9AE9905FFD7803F25714661B63B535A4C206CA9 && \
curl -o node-${VERSION}.tar.gz -sSL https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz && \
curl -o SHASUMS256.txt.asc -sSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc && \
gpg --verify SHASUMS256.txt.asc && \
grep node-${VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - && \
tar -zxf node-${VERSION}.tar.gz && \
cd node-${VERSION} && \
export GYP_DEFINES="linux_use_gold_flags=0" && \
./configure --prefix=/usr ${CONFIG_FLAGS} && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
make -j${NPROC} -C out mksnapshot BUILDTYPE=Release && \
paxctl -cm out/Release/mksnapshot && \
make -j${NPROC} && \
make install && \
paxctl -cm /usr/bin/node && \
cd / && \
if [ -x /usr/bin/npm ]; then \
npm install -g npm@${NPM_VERSION} && \
find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \
fi && \
apk del make gcc g++ python linux-headers paxctl gnupg ${DEL_PKGS} && \
rm -rf /node-${VERSION}.tar.gz /SHASUMS256.txt.asc /node-${VERSION} ${RM_DIRS} \
/usr/share/man /tmp/* /root/.npm /root/.node-gyp /root/.gnupg \
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html
COPY ./ /tengine-website-generator
WORKDIR /tengine-website-generator
RUN ./bin/install.sh --use-cnpm-mirror
RUN npm install -g hexo --registry=https://registry.npm.taobao.org
RUN npm install -g hexo-cli --registry=https://registry.npm.taobao.org
EXPOSE 4000:4000