- cp
Dockerfile
anddocker-entrypoint.sh
to top directory of tinyproxy - Build docker image with
Dockerfile
- Run container:
docker run --rm -d -p ${HostPort}:${ContainerPort} -e ALLOWIPS=${ALLOWIPs} -e PORT=${ContainerPort} --name tinyproxy tinyproxy
Last active
January 7, 2025 18:35
-
-
Save JingyZhu/41bc13e15bb032751063c5b31cadbfc0 to your computer and use it in GitHub Desktop.
Build a docker for tinyproxy with customized whitelist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PORT=${PORT:-8888} | |
ALLOWIPS=${ALLOWIPS} | |
ALLOWSTR=$(echo ${ALLOWIPS} | sed 's/:/\nAllow /') | |
if [[ "$ALLOWSTR" ]]; then | |
ALLOWSTR="Allow ${ALLOWSTR}" | |
fi | |
echo """Port ${PORT} | |
Timeout 600 | |
DefaultErrorFile \"/usr/local/share/tinyproxy/default.html\" | |
StatFile \"/usr/local/share/tinyproxy/stats.html\" | |
LogLevel Info | |
MaxClients 100 | |
Allow 127.0.0.1 | |
${ALLOWSTR} | |
Allow ::1 | |
ConnectPort 443 | |
ConnectPort 563 | |
""" > tinyproxy.conf | |
nohup tinyproxy -c ./tinyproxy.conf -d > tinyproxy.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
RUN mkdir -p /home/tinyproxy | |
COPY . /home/tinyproxy | |
WORKDIR /home/tinyproxy | |
RUN apt update && apt install -y build-essential | |
RUN ./autogen.sh | |
RUN ./configure | |
RUN make && make install | |
ENTRYPOINT [ "./docker-entrypoint.sh" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment