2020-04-17 03:55:57 -07:00
# RIPE Atlas Docker Image
This is the [RIPE Atlas software probe ](https://atlas.ripe.net/docs/software-probe/ ) packaged as a Docker image.
2020-04-17 04:03:55 -07:00
[](https://dev.azure.com/nekomimiswitch/General/_build/latest?definitionId=83& branchName=master)
2020-04-17 12:19:38 -07:00
## Requirements
* 1 CPU core (of course)
* 20MiB memory
* 100MiB HDD
2020-04-17 12:20:26 -07:00
* A Linux installation with Docker installed
2020-04-17 12:19:38 -07:00
* Internet access
2022-05-12 13:48:22 -04:00
## Tags
2022-05-14 18:44:25 +08:00
The following prebuilt tags are available at [Docker Hub ](https://hub.docker.com/r/jamesits/ripe-atlas ). The `latest` tag supports [multi-arch ](https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ ), and should be used by default.
2022-05-12 13:48:22 -04:00
* **`latest` : For all supported devices listed below (multi-arch)**
* `latest-arm64` : For arm64 (aarch64) devices
* `latest-armel` : For armv6l (armel) devices
* `latest-armv7l` : For armv7l (armhf) devices
* `latest-i386` : For i386 devices
* `latest-amd64` : For amd64 devices
2020-04-17 03:55:57 -07:00
## Running
2022-05-14 18:33:13 +08:00
### Using `docker run`
2020-04-17 04:31:28 -07:00
First we start the container:
2020-04-17 03:55:57 -07:00
```shell
2022-02-07 18:01:12 +08:00
docker run --detach --restart=always \
--log-driver json-file --log-opt max-size=10m \
2020-04-17 23:33:35 -07:00
--cpus=1 --memory=64m --memory-reservation=64m \
2022-05-14 18:33:13 +08:00
--cap-drop=ALL --cap-add=CHOWN --cap-add=SETUID --cap-add=SETGID --cap-add=DAC_OVERRIDE --cap-add=NET_RAW \
2020-04-17 05:54:41 -07:00
-v /var/atlas-probe/etc:/var/atlas-probe/etc \
-v /var/atlas-probe/status:/var/atlas-probe/status \
2020-04-17 23:33:35 -07:00
-e RXTXRPT=yes \
--name ripe-atlas --hostname "$(hostname --fqdn)" \
2020-04-17 05:08:26 -07:00
jamesits/ripe-atlas:latest
2020-04-17 03:55:57 -07:00
```
2020-04-17 04:31:28 -07:00
2022-05-14 18:33:13 +08:00
### Using Docker Compose
2022-05-14 18:38:33 +08:00
An example [`docker-compose.yaml` ](/docker-compose.yaml ) is provided.
```shell
git clone https://github.com/Jamesits/docker-ripe-atlas.git
cd docker-ripe-atlas
docker-compose pull
docker-compose up -d
```
2022-05-14 18:33:13 +08:00
2022-05-14 18:44:25 +08:00
## Registering the Probe
Fetch the generated public key:
```shell
cat /var/atlas-probe/etc/probe_key.pub
```
[Register ](https://atlas.ripe.net/apply/swprobe/ ) the probe with your public key. After the registration being manually processed, you'll see your new probe in your account.
2022-05-14 18:33:13 +08:00
## Building
2022-05-14 18:44:25 +08:00
If you don't want to use the prebuilt image hosted on the Docker Hub, you can build your own image.
2022-05-14 18:33:13 +08:00
```shell
DOCKER_BUILDKIT=1 docker build -t ripe-atlas .
```
Note that building this container image requires [BuildKit ](https://docs.docker.com/develop/develop-images/build_enhancements/ ).
2020-04-17 04:50:10 -07:00
## Caveats
### IPv6
2022-05-12 01:10:54 -04:00
Docker's IPv6 support is still [like shit ](https://github.com/moby/moby/issues/25407 ). As a workaround, you can use IPv6 NAT using either `docker-ipv6nat` or native method (experimental).
First, edit kernel parameters.
2020-04-17 04:50:10 -07:00
```shell
cat > /etc/sysctl.d/50-docker-ipv6.conf < < EOF
net.ipv6.conf.eth0.accept_ra=2
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1
EOF
sysctl -p /etc/sysctl.d/50-docker-ipv6.conf
2022-05-12 01:10:54 -04:00
```
Note this might break your network and your mileage may vary. You should swap `eth0` with your primary network adapter name, and if you use static IPv6 assignment instead of SLAAC, change `accept_ra` to `0` .
#### Using robbertkl/docker-ipv6nat
```shell
2020-04-17 04:50:10 -07:00
docker network create --ipv6 --subnet=fd00:a1a3::/48 ripe-atlas-network
docker run -d --restart=always -v /var/run/docker.sock:/var/run/docker.sock:ro -v /lib/modules:/lib/modules:ro --cap-drop=ALL --cap-add=NET_RAW --cap-add=NET_ADMIN --cap-add=SYS_MODULE --net=host --name=ipv6nat robbertkl/ipv6nat:latest
```
2020-04-17 05:08:26 -07:00
Then start the RIPE Atlas container with argument `--net=ripe-atlas-network` .
2022-05-12 01:10:54 -04:00
#### Using native method (experimental)
Edit `/etc/docker/daemon.json` , then restart docker daemon.
```json
{
"experimental": true,
"ipv6": true,
"ip6tables": true,
"fixed-cidr-v6": "fd00:a1a3::/48"
}
```
2020-04-17 04:50:10 -07:00
### Auto Update
Use this recipe for auto updating the docker container.
```shell
2022-05-08 11:37:38 +08:00
docker run --detach --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name watchtower containrrr/watchtower --cleanup --label-enable
2020-04-17 04:50:10 -07:00
```
2020-04-17 04:31:28 -07:00
2020-04-17 04:50:10 -07:00
Then start the RIPE Atlas container with argument `--label=com.centurylinklabs.watchtower.enable=true` .
2020-04-17 05:00:35 -07:00
### Backup
All the config files are stored at `/var/atlas-probe` . Just backup it.