1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-20 22:08:39 +00:00

add ngrok

This commit is contained in:
kev 2015-12-05 02:25:31 +08:00
parent e7ba0cd042
commit 248591be91
4 changed files with 93 additions and 0 deletions

@ -46,6 +46,7 @@ dockerfiles
- [x] monit
- [x] nginad
- [x] nginx
- [x] ngrok :+1:
- [x] nodered :+1:
- [x] nodered-arm :+1:
- [x] obfsproxy

62
ngrokd/Dockerfile Normal file

@ -0,0 +1,62 @@
#
# Dockerfile for ngrokd
#
FROM debian:jessie
MAINTAINER kev <noreplay@datageek.info>
ENV NGROK_GIT https://github.com/inconshreveable/ngrok.git
ENV NGROK_BASE_DOMAIN ngrok.foobar.site
ENV NGROK_DIR /ngrok
ENV NGROK_TMP /tmp/ngrok
ENV NGROK_CA_KEY assets/client/tls/ngrokroot.key
ENV NGROK_CA_CRT assets/client/tls/ngrokroot.crt
ENV NGROK_SERVER_KEY assets/server/tls/snakeoil.key
ENV NGROK_SERVER_CSR assets/server/tls/snakeoil.csr
ENV NGROK_SERVER_CRT assets/server/tls/snakeoil.crt
WORKDIR $NGROK_DIR
RUN apt-get update \
&& apt-get install -y build-essential \
curl \
git \
golang \
mercurial \
&& git clone ${NGROK_GIT} ${NGROK_TMP} \
&& cd ${NGROK_TMP} \
&& openssl genrsa -out ${NGROK_CA_KEY} 2048 \
&& openssl req -new -x509 -nodes -key ${NGROK_CA_KEY} -subj "/CN=${NGROK_BASE_DOMAIN}" -days 365 -out ${NGROK_CA_CRT} \
&& openssl genrsa -out ${NGROK_SERVER_KEY} 2048 \
&& openssl req -new -key ${NGROK_SERVER_KEY} -subj "/CN=${NGROK_BASE_DOMAIN}" -out ${NGROK_SERVER_CSR} \
&& openssl x509 -req -in ${NGROK_SERVER_CSR} -CA ${NGROK_CA_CRT} -CAkey ${NGROK_CA_KEY} -CAcreateserial -days 365 -out ${NGROK_SERVER_CRT} \
&& for GOOS in darwin linux windows; \
do \
for GOARCH in 386 amd64 arm; \
do \
echo "=== $GOOS-$GOARCH ==="; \
export GOOS GOARCH; \
make release-all; \
echo "=== done ==="; \
done \
done \
&& mv ${NGROK_CA_KEY} \
${NGROK_CA_CRT} \
${NGROK_SERVER_KEY} \
${NGROK_SERVER_CSR} \
${NGROK_SERVER_CRT} \
./bin/* \
${NGROK_DIR} \
&& apt-get purge --auto-remove -y build-essential \
curl \
git \
golang \
mercurial \
&& cd ${NGROK_DIR} \
&& rm -rf ${NGROK_TMP}
VOLUME $NGROK_DIR
EXPOSE 80 443 4443
ENTRYPOINT ["./ngrokd"]

15
ngrokd/README.md Normal file

@ -0,0 +1,15 @@
ngrokd
======
[ngrok][1] is a reverse proxy that creates a secure tunnel from a public endpoint to
a locally running web service. ngrok captures and analyzes all traffic over the
tunnel for later inspection and replay.
**IMPORTANT**:
- Change `NGROK_BASE_DOMAIN` in `Dockerfile`
- Rebuild the image
- Run container
- Copy binaries/keys from container
[1]: https://github.com/inconshreveable/ngrok

15
ngrokd/docker-compose.yml Normal file

@ -0,0 +1,15 @@
ngrokd:
image: vimagick/ngrokd
command: >
-domain=ngrok.foobar.site
-httpAddr=:2080
-httpsAddr=:2443
-tunnelAddr=:4443
-tlsCrt=snakeoil.crt
-tlsKey=snakeoil.key
-log-level=INFO
ports:
- "2080:2080"
- "2443:2443"
- "4443:4443"
restart: always