Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create docker containers #97

Open
Mubelotix opened this issue Aug 14, 2023 · 2 comments 路 May be fixed by #98
Open

Create docker containers #97

Mubelotix opened this issue Aug 14, 2023 · 2 comments 路 May be fixed by #98

Comments

@Mubelotix
Copy link
Owner

The container needs to expose access to tcp ports 4002 and 5002.
It should be made so that port 4001 is accessible from the inside.

I'm not sure whether it should include the webui or not 馃

It would be great if there could also be a second container for the second flavor of the daemon.
Unlike the default daemon that uses no storage and has to index everything when started, the second flavors stores an index on-disk.
The storage-using daemon can be obtained by compiling with the database-lmdb feature.
The corresponding container should have a persistent volume to mount to.

@jphastings
Copy link

It seems that an effective way to handle the stroage-using daemon case would be to always compile/build with the database-lmdb code, but turn the feature on or off depending on whether a persistent volume is made available to the container.

I'd implement this in the docker image by:

  1. Setting up the Docker image to have a directory at /data or similar
  2. Have that directory inside the image contain a file like .admarus-no-stored-index
  3. Set up the launch command for Admarus in the container to be something like admarusd --store-index=$([[ -f "/data/.admarus-np-stored-index" ]] && "false" || "/data")

Now, when someone runs the docker image with a volume mapped to /data, the .admarus-no-stored-index isn't present, and the server will store in the mounted volume. When the image has no mapped volume, the presence of the .admarus-no-stored-index turns off that feature.

@Mubelotix
Copy link
Owner Author

I would agree with you if that was possible. Unfortunately, enabling database-lmdb disables the in-memory index. That's due to implementation details. What can be done however is compiling both binaries and shipping them both in the same container. Depending on the presence of a mounted volume, one of them could be called. Would that be convenient?

jphastings added a commit to jphastings/admarus that referenced this issue Aug 28, 2023
Builds a Debian Bookworm (slim) docker container with Admarus pre-built inside it, and the OpenSSL dynamic libraries.

Run with:

```sh
docker run --network=host ghcr.io/Mubelotix/admarus:master \
  --ipfs-rpc=http://host.docker.internal:5001 \
  --external-addrs=/ip4/$(curl -s https://api.ipify.org)/tcp/4002 \
  --external-addrs=/ip6/$(curl -s https://api64.ipify.org)/tcp/4002 \
```

fixes Mubelotix#97
@jphastings jphastings linked a pull request Aug 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants