Setting up i2p running in a docker container

Heard of i2p? Wans to give it an try? Y not docker? Leaves your host system untouched. Can throw it away leaving no* footprint (* usual restrictions apply).

Have an Dockerfile:

FROM debian:jessie
MAINTAINER Gooby <gooby@pls.com>
EXPOSE 4444 4445 4446 4447 7657 7654 6668

RUN apt-get update && apt-get upgrade
RUN apt-get install -y openjdk-7-jre-headless wget curl socat

RUN echo "deb http://deb.i2p2.no/ jessie main" >> /etc/apt/sources.list
RUN echo "deb-src http://deb.i2p2.no/ jessie main" >> /etc/apt/sources.list
RUN wget -qO - https://geti2p.net/_static/i2p-debian-repo.key.asc | apt-key add -

RUN apt-get update && apt-get upgrade
RUN apt-get install -y i2p i2p-keyring

RUN useradd i2pproc && mkdir /home/i2pproc && chown i2pproc:i2pproc /home/i2pproc

COPY start.sh /tmp/
ENTRYPOINT ["/tmp/start.sh"]

Together with (place in same directory as the Dockerfile):

#!/bin/bash

su i2pproc -c "i2prouter start"

sed -i s/i2cp.tcp.bindAllInterfaces=.*/i2cp.tcp.bindAllInterfaces=true/g /home/i2pproc/.i2p/router.config
sed -i s/::1,127.0.0.1/0.0.0.0/ /home/i2pproc/.i2p/clients.config

su i2pproc -c "i2prouter restart"

socat TCP-LISTEN:4446,fork TCP:localhost:4444 &
socat TCP-LISTEN:4447,fork TCP:localhost:4445 &

/bin/bash

Starting the fun:

/path/to/i2p$ docker build -t i2p . && docker run --rm --name=i2p -it i2p

When configuring the browser proxy, run

docker inspect --format '{{ .NetworkSettings.IPAddress }}' i2p

to get the IP to enter into the proxy host and use 4446 and 4447 as ports. Modify the scripts as you seem fit for customization.

Advertisements

About goobypl5

pizza baker, autodidact, particle physicist
This entry was posted in Security/Encryption and tagged , , . Bookmark the permalink.

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s