dever 5 years ago
parent
commit
0860d7f978

+ 7 - 3
src/docker/build/iot/ngrok/Dockerfile

@@ -5,13 +5,17 @@ MAINTAINER Rabin "https://github.com/shemic"
 ENV NG_DOMAIN="ngrok.dever.cc"
 ENV NG_NAME=ngrok
 ENV NG_HOME=/usr/local/$NG_NAME
-ENV PATH=$PATH:$NG_HOME
+ENV PATH=$PATH:$NG_HOME/bin
 
-RUN apk add --no-cache git make openssl  && \
+RUN sed -i "s/http:\/\/dl-cdn.alpinelinux.org/http:\/\/mirrors.ustc.edu.cn/g" /etc/apk/repositories && apk --no-cache --update add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && date && apk del tzdata && mkdir /entrypoint && mkdir /share
+
+VOLUME ["/share"]
+
+RUN apk add --no-cache --update git make openssl  && \
 	git clone https://github.com/inconshreveable/ngrok.git --depth=1 $NG_HOME
 
 ADD build.sh /
-#RUN sh /build.sh
+RUN sh /build.sh
 
 EXPOSE 8081
 

+ 2 - 2
src/docker/build/iot/ngrok/build.sh

@@ -2,9 +2,9 @@
 
 cd $NG_HOME
 openssl genrsa -out rootCA.key 2048
-openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pem
+openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NG_DOMAIN" -days 5000 -out rootCA.pem
 openssl genrsa -out device.key 2048
-openssl req -new -key device.key -subj "/CN=$NGROK_DOMAIN" -out device.csr
+openssl req -new -key device.key -subj "/CN=$NG_DOMAIN" -out device.csr
 openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
 cp rootCA.pem assets/client/tls/ngrokroot.crt
 cp device.crt assets/server/tls/snakeoil.crt

+ 1 - 1
src/docker/conf/iot.conf

@@ -39,4 +39,4 @@ alias = apidoc
 
 [ngrok]
 port = 8081:8081
-command = sh
+command = ngrokd