diva-exchange / i2p

I2P Layer of diva.exchange. Based on i2pd, see https://github.com/PurpleI2P/i2pd
GNU General Public License v3.0
28 stars 8 forks source link

Make /home/i2pd mountable as a docker volume #10

Closed ShrirajHegde closed 3 weeks ago

ShrirajHegde commented 3 months ago

Fixes #5 without breaking any previous behaviour.

Also fixes #7. https://github.com/ShrirajHegde/i2pd/commit/166a34e777de10bb6019fb1e1d4e54f54bac39ff#r143904943

ShrirajHegde commented 3 months ago

@diva-exchange Can you provide the Dockerfile and entrypoint.sh for divax/i2p:current-i2p-tor image?

diva-exchange commented 3 months ago

https://github.com/diva-exchange/i2p/blob/i2p-tor/Dockerfile

https://github.com/diva-exchange/i2p/blob/i2p-tor/entrypoint.sh

ShrirajHegde commented 3 months ago

Hey @diva-exchange, I got the entrypoint.sh from your image and modified the Dockerfile to include tor.

Let me know if you want any more information.

diva-exchange commented 3 weeks ago

Thank you - great feedback and great changes. Merged it and will test it with i2pd 2.54.0. One question remains: How to do build multi-platform images? Can this be included in the build.sh script?

ShrirajHegde commented 3 weeks ago

@diva-exchange, yes.

I can build and push by

docker buildx build . \
    --platform linux/arm64,linux/amd64,linux/arm/v7 \
     -t shrirajhegde/i2pd-tor --push -f Dockerfile-tor

See that I am specifying all the platform and the specific docker file. https://hub.docker.com/r/shrirajhegde/i2pd-tor

image

When it's built like this, if you do shrirajhegde/i2pd-tor:latest, your system will choose the architecture accordingly with no changes to docker compose or the docker run command.

For non tor variant, I do

docker buildx build . \
    --platform linux/arm64,linux/amd64,linux/arm/v7 \
     -t shrirajhegde/i2pd --push -f Dockerfile

https://hub.docker.com/r/shrirajhegde/i2pd/tags

But I would advice you to use GitHub actions like I do. I have set it up to build the image every week automatically. And the new image will be tagged with latest and git-<commit_hash> of i2pd repo.

It runs weekly at 9AM UTC : https://github.com/ShrirajHegde/i2pd/actions.

ShrirajHegde commented 3 weeks ago

Let me know if you need help with setting up GitHub actions.

It's almost setup. It only requires minor changes and adding your docker secrets to GitHub.

diva-exchange commented 3 weeks ago

Great & thanks! Will enable github actions on the main branch. Reason: don't want to push develop branch to docker (since PR's [and also some not-that-well-tested commits] go to develop branch). But tested and approved stuff (which is the main branch) shall be published on docker hub.

ShrirajHegde commented 3 weeks ago

If you need high stability, you need to checkout the latest release tag when building i2pd.

They might have commits that are not fully ready to be used too.

Let me know if you want to to implement that in the GitHub actions.

ShrirajHegde commented 3 weeks ago

This commit also addresses #6. I am not sure if it fully fixes the issue.