2021-05-08 09:30:35 -04:00
|
|
|
Signing News and Hosting a News Server with Docker
|
|
|
|
==================================================
|
|
|
|
|
|
|
|
i2p.newsxml has two containers, one for hosting the news itself, and one which
|
|
|
|
is used for running `news.sh` and `generate_news.py` in a container on Linux
|
2021-10-20 00:48:26 -04:00
|
|
|
distributions where Python2 support is limited or unavailable. It's also useful
|
|
|
|
if you simply prefer to manage Docker containers using Docker's or related
|
|
|
|
project's tooling(Portainer or sen for instance).
|
2021-05-08 09:30:35 -04:00
|
|
|
|
|
|
|
## To build the signing container, use:
|
|
|
|
|
|
|
|
``` sh
|
2021-08-23 18:26:56 -04:00
|
|
|
docker build --no-cache -t i2p.newsxml.signing -f Dockerfile.signing .
|
2021-05-08 09:30:35 -04:00
|
|
|
```
|
|
|
|
|
2021-12-08 23:06:32 -05:00
|
|
|
To run news.sh in the container, prepare your etc/su3.vars.custom.docker file as
|
|
|
|
if your signing keys directory were mounted at `/.i2p-plugin-keys`. No other
|
|
|
|
differences should be required between a Docker and non-docker `news.sh` run
|
2021-05-08 09:30:35 -04:00
|
|
|
|
|
|
|
``` sh
|
|
|
|
docker run -it \
|
|
|
|
-u $(id -u):$(id -g) \
|
|
|
|
--name i2p.newsxml.signing \
|
|
|
|
-v $HOME/.i2p-plugin-keys/:/.i2p-plugin-keys/:ro \
|
|
|
|
-v $HOME/i2p/:/i2p/:ro \
|
|
|
|
i2p.newsxml.signing
|
|
|
|
```
|
|
|
|
|
|
|
|
Then, extract the built feeds from the container:
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
docker cp i2p.newsxml.signing:/opt/i2p.newsxml/build build
|
|
|
|
```
|
|
|
|
|
2021-08-23 18:26:56 -04:00
|
|
|
``` sh
|
|
|
|
docker build --no-cache -t i2p.newsxml.signing -f Dockerfile.signing .
|
|
|
|
docker rm -f i2p.newsxml.signing
|
|
|
|
docker run -it \
|
|
|
|
-u $(id -u):$(id -g) \
|
|
|
|
--name i2p.newsxml.signing \
|
|
|
|
-v $HOME/.i2p-plugin-keys/:/.i2p-plugin-keys/:ro \
|
|
|
|
-v $HOME/i2p/:/i2p/:ro \
|
|
|
|
i2p.newsxml.signing
|
|
|
|
docker cp i2p.newsxml.signing:/opt/i2p.newsxml/build build
|
|
|
|
```
|
|
|
|
|
2021-05-08 09:30:35 -04:00
|
|
|
## Now, you're ready to build the hosting container:
|
|
|
|
|
|
|
|
With the feeds in `build` from the previous step, run:
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
docker build -t i2p.newsxml .
|
|
|
|
```
|
|
|
|
|
|
|
|
then, to serve the files on a local port:
|
|
|
|
|
|
|
|
``` sh
|
2021-08-23 18:26:56 -04:00
|
|
|
docker run -d --restart=always --name newsxml -p 127.0.0.1:3000:3000 i2p.newsxml
|
|
|
|
```
|
|
|
|
|
|
|
|
``` sh
|
|
|
|
docker build -t i2p.newsxml .
|
2021-12-20 16:18:37 -05:00
|
|
|
docker rm -f newsxml
|
2021-08-23 18:26:56 -04:00
|
|
|
docker run -d --restart=always --name newsxml -p 127.0.0.1:3000:3000 i2p.newsxml
|
2021-05-08 09:30:35 -04:00
|
|
|
```
|