Skip to content

Commit 016b5c1

Browse files
author
Evgenii Skiridov
committed
First
0 parents  commit 016b5c1

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Browser Mob Proxy
2+
3+
FROM ubuntu:16.04
4+
5+
ENV DEBIAN_FRONTEND noninteractive
6+
7+
#========================
8+
# Miscellaneous packages
9+
# Includes minimal runtime used for executing non GUI Java programs
10+
#========================
11+
RUN apt-get update -qqy \
12+
&& apt-get -qqy --no-install-recommends install \
13+
bzip2 \
14+
ca-certificates \
15+
openjdk-8-jre-headless \
16+
sudo \
17+
unzip \
18+
wget \
19+
&& rm -rf /var/lib/apt/lists/* \
20+
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
21+
22+
# BMP install
23+
ENV BMP_VERSION 2.1.1
24+
RUN wget -O browsermob-proxy.zip https://github.com/lightbody/browsermob-proxy/releases/download/browsermob-proxy-$BMP_VERSION/browsermob-proxy-$BMP_VERSION-bin.zip \
25+
&& unzip -q /browsermob-proxy.zip \
26+
&& rm -f /browsermob-proxy.zip
27+
28+
RUN mv /browsermob-proxy-$BMP_VERSION /browsermob-proxy
29+
30+
COPY start.sh /
31+
RUN chmod +x /start.sh
32+
33+
# ENV VALUE
34+
ENV BMP_PORT 9090
35+
ENV PORT_RANGE 39500-39999
36+
ENV TTL 600
37+
38+
CMD ["/start.sh"]

start.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
export BMP_PORT
4+
export PORT_RANGE
5+
export TTL
6+
7+
echo "BMP port is $BMP_PORT"
8+
echo "Port Range is $PORT_RANGE"
9+
echo "TTL is $TTL"
10+
11+
/browsermob-proxy/bin/browsermob-proxy -port $BMP_PORT -proxyPortRange $PORT_RANGE -ttl $TTL

0 commit comments

Comments
 (0)