forked from xingetouzi/dyupdater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
109 lines (82 loc) · 3.8 KB
/
Dockerfile
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
FROM golang:1.9-rc-stretch
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
RUN apt-get update \
&& apt-get install -y unzip xz-utils unixodbc unixodbc-dev libaio1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# gpg keys listed at https://github.com/nodejs/node#release-team
RUN set -ex \
&& for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
56730D5401028683275BD23C23EFEFE93C4CFFFE \
77984A986EBC2AA786BC0F66B01FBB92821C587A \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
; do \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done
ENV NODE_VERSION 10.5.0
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
# test
# RUN node -v && npm --version
ENV YARN_VERSION 1.7.0
RUN npm install -g yarn@${YARN_VERSION}
RUN wget -O /usr/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && chmod +x /usr/bin/dep
WORKDIR /go/src/fxdayu.com/dyupdater
ENV ORACLE_BASE=/opt/oracle ORACLE_HOME=/opt/oracle/instantclient_11_2
ENV PKG_CONFIG_PATH="/go/src/fxdayu.com/dyupdater/server:${PKG_CONFIG_PATH}" \
PATH="$ORACLE_HOME:$PATH" \
LD_LIBRARY_PATH="$ORACLE_HOME:${LD_LIBRARY_PATH}" \
C_INCLUDE_PATH="$ORACLE_HOME/sdk/include/:${C_INCLUDE_PATH}" \
TNS_ADMIN=$ORACLE_HOME/network/admin NLS_LANG=AMERICAN_AMERICA.UTF8
RUN wget -q https://github.com/bumpx/oracle-instantclient/raw/master/instantclient-basic-linux.x64-11.2.0.4.0.zip
RUN wget -q https://github.com/bumpx/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip
RUN mkdir $ORACLE_BASE \
&& unzip instantclient-basic-linux.x64-11.2.0.4.0.zip -d $ORACLE_BASE \
&& unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip -d $ORACLE_BASE \
&& ln -s $ORACLE_HOME/libclntsh.so.11.1 /usr/lib/libclntsh.so
ENV FREETDS_VERSION=1.00.92
RUN wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-${FREETDS_VERSION}.tar.gz \
&& tar xf freetds-${FREETDS_VERSION}.tar.gz \
&& cd freetds-${FREETDS_VERSION}/ \
&& ./configure \
&& make \
&& make install \
&& echo "[FreeTDS]" > tds.driver.template \
&& echo "Description = Open source FreeTDS driver" >> tds.driver.template \
&& echo "Driver =/usr/local/lib/libtdsodbc.so" >> tds.driver.template \
&& odbcinst -i -d -f tds.driver.template
# test
# RUN echo $ORACLE_HOME $LD_LIBRARY_PATH $C_INCLUDE_PATH $PKG_CONFIG_PATH
COPY ./Makefile ./
COPY ./client/package.json ./client/
RUN make install-client
COPY ./Gopkg.toml ./
COPY . .
RUN make install-server
RUN make build
RUN chmod +x dyupdater && cp dyupdater /usr/local/bin
CMD ["dyupdater", "run", "-H", "0.0.0.0"]