This repository has been archived by the owner on Aug 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.arm7
171 lines (138 loc) · 6.8 KB
/
Dockerfile.arm7
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
FROM multiarch/alpine:armhf-v3.6 as build
#add glibc
RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \
ALPINE_GLIBC_PACKAGE_VERSION="2.26-r0" && \
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
wget \
"https://raw.githubusercontent.com/andyshinn/alpine-pkg-glibc/master/sgerrand.rsa.pub" \
-O "/etc/apk/keys/sgerrand.rsa.pub" && \
wget \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
apk add --no-cache \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
\
rm "/etc/apk/keys/sgerrand.rsa.pub" && \
/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true && \
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
\
apk del glibc-i18n && \
\
rm "/root/.wget-hsts" && \
apk del .build-dependencies && \
rm \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"
#geos-3.4.3
RUN apk update && apk add g++ make automake autoconf cmake sqlite-dev linux-headers zlib-dev \
&& apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ proj4-dev \
&& wget http://download.osgeo.org/geos/geos-3.4.3.tar.bz2 \
&& bunzip2 geos-3.4.3.tar.bz2 \
&& tar xvf geos-3.4.3.tar \
&& cd geos-3.4.3 \
&& ./configure && make && make install && cd .. && rm -rf geos-3.4.3
#libspatialite-4.3.0
RUN wget http://www.gaia-gis.it/gaia-sins/libspatialite-4.3.0a.tar.gz \
&& tar xzf libspatialite-4.3.0a.tar.gz \
&& rm libspatialite-4.3.0a.tar.gz \
&& cd libspatialite-4.3.0a \
&& CFLAGS="-DSQLITE_ENABLE_RTREE=1" ./configure --disable-freexl --disable-libxml2 \
&& make && make install
RUN apk add protobuf-dev
ADD ./ /iop-locnet/
RUN cd iop-locnet && \
cd generated && sh regenerate.sh && cd .. && sh build.sh
FROM multiarch/alpine:armhf-v3.6
MAINTAINER wessel<[email protected]>
ENV IOP_VERSION v1.2-Beta
ENV IOP_PLATFORM linux-64
# Ports for node2node, client2node, interprocess communication between local services
EXPOSE 16980
EXPOSE 16981
EXPOSE 16982
# Public node id, should be an SHA256 hash of the public key of this node
#ENV NODEID
# TCP port to serve client (i.e. end user) queries. Optional,default value: 16981
ENV CLIENTPORT 16981
# TCP port to serve other IoP services running on this node. Optional, default value: 16982
ENV LOCALPORT 16982
# TCP port to serve node to node communication. Optional, default value: 16980
#Should only be locally available
ENV NODEPORT 16980
ENV IOPLOC_PATH "/data/locnet/"
# Path to config file to load options from. Optional, default value: ~/.iop-locnet/iop-locnet.cfg
ENV CONFIGFILE "/data/locnet/iop-locnet.cfg"
#Path to db file. Optional, default value: ~/.iop-locnet/locnet.sqlite
ENV DBPATH "/data/locnet/iop-locnet.sqlite"
# Path to log file. Optional, default value: ~/.iop-locnet/debug.log
ENV LOGPATH "/data/locnet/debug.log"
# Externally accessible IP address (ipv4 or v6) to be advertised for other nodes or clients. Required for seeds only, autodetected otherwise.
#ENV HOST
# GPS latitude of this server as real number from range ((-90,90)
#ENV LATITUDE 48.2081743
# GPS longitude of this server as real number from range (-180,180)
#ENV LONGITUDE 16.3738189
# Host name of seed node to be used instead of default seeds. You can repeat this option to define multiple custom seed nodes.
#ENV SEEDNODE
#allows specifying any network device considered as local network instead of localhost
ENV LOCALDEVICE "127.0.0.1"
#add glibc
RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \
ALPINE_GLIBC_PACKAGE_VERSION="2.26-r0" && \
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
apk add --no-cache --virtual=.build-dependencies ca-certificates wget && \
wget \
"https://raw.githubusercontent.com/andyshinn/alpine-pkg-glibc/master/sgerrand.rsa.pub" \
-O "/etc/apk/keys/sgerrand.rsa.pub" && \
wget \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
apk add --no-cache \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
\
rm "/etc/apk/keys/sgerrand.rsa.pub" && \
/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true && \
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
\
apk del glibc-i18n && \
\
rm "/root/.wget-hsts" && \
rm \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"
WORKDIR /
ADD docker/run.sh run.sh
COPY --from=build /iop-locnet/build/src/iop-locnetd /usr/local/bin/iop-locnetd
COPY --from=build /usr/local/lib/libspatialite.so.7 /usr/local/lib/libspatialite.so.7
COPY --from=build /usr/local/lib/libgeos_c.so.1 /usr/local/lib/libgeos_c.so.1
COPY --from=build /usr/local/lib/libgeos-3.4.3.so /usr/local/lib/libgeos-3.4.3.so
RUN mkdir -p $IOPLOC_PATH && adduser -D -h $IOPLOC_PATH -u 1000 iop \
&& chown iop:iop $IOPLOC_PATH && chmod 755 $IOPLOC_PATH && chown iop:iop /usr/local/bin/iop-locnetd \
&& chown -Rv 1000:$GID /usr/local/bin \
&& /usr/glibc-compat/sbin/ldconfig \
&& apk update && apk add protobuf protobuf-dev sqlite-dev \
&& apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ proj4-dev \
&& /usr/glibc-compat/sbin/ldconfig \
&& chmod +x run.sh
# Call uid 1000 "loc"
USER iop
# Expose the fs-repo as a volume.
# We're doing this down here (and not at the top),
# so that the overlay directory is owned by the loc user.
# start_loc initializes an ephemeral fs-repo if none is mounted,
# which is why uid=1000 needs write permissions there.
VOLUME $IOPLOC_PATH
ENTRYPOINT "/run.sh"