Skip to content

Commit 421bd55

Browse files
committed
docker: update readme to reflect changes to setup script
1 parent d8b0ade commit 421bd55

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

docker/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This guide provides instructions on how to build, run, and manage the `sim-ln` D
77
- Docker installed on your machine.
88
- A `sim.json` file that contains your specific configuration.
99

10-
## Building the Docker Image
10+
## 1. Building the Docker Image
1111

1212
To build the Docker image, execute:
1313

@@ -17,7 +17,7 @@ make build-docker
1717

1818
This command will make the necessary preparations and build the Docker image.
1919

20-
## Mounting the Volume
20+
## 2. Mounting the Volume
2121

2222
To ensure that the Docker container can access the configuration and authentication credentials, we use Docker volumes. Before you can run the container, you need to set up the volume with the authentication credentials.
2323

@@ -30,6 +30,7 @@ make mount-volume SIMFILE_PATH=/path/to/your/sim.json
3030
Replace `/path/to/your/sim.json` with the actual path to your `sim.json` file.
3131

3232
The script will automatically copy your configuration, certificates, macaroons, and other authentication config to a Docker volume named simln-data.
33+
It will also replace `localhost` addresses with `host.docker.internal` so that docker is able to make queries from inside of the container.
3334

3435
*Note:* The path to your config must be an absolute path not relative e.g. "/Users/anonymous/bitcoin-dev-project/sim-ln/sim.json"
3536

@@ -40,12 +41,14 @@ If you're running nodes on a remote machine, or if you have a more complex setup
4041
1. Create a Docker volume named simln-data.
4142
2. Copy your configuration, certificates, macaroons, etc., to the volume.
4243
3. Adjust the paths in sim.json to point to the appropriate locations within the volume.
44+
4. Ensure that your addresses are reachable from *within* the docker container.
4345

44-
---
46+
<details>
47+
<summary>Tip: Using host.docker.internal</summary>
4548

46-
## Using Docker Host's Internal IP
49+
Docker provides a special DNS name `host.docker.internal` that resolves to the host machine's IP address because we can't `localhost` or `127.0.0.1` for the IP address.
4750

48-
Docker provides a special DNS name `host.docker.internal` that resolves to the host machine's IP address because we can't `localhost` or `127.0.0.1` for the IP address.
51+
This value can be used when trying to access things running on the local machine from within a docker container.
4952

5053
For instance, in your configuration:
5154

@@ -59,10 +62,9 @@ For instance, in your configuration:
5962
```
6063

6164
In the above example, the `address` field uses `host.docker.internal` to refer to a service running on port `10002` on the host machine. This special DNS name ensures that your containerized application can reach out to services running on the host.
65+
</details>
6266

63-
---
64-
65-
## Running the Docker Container
67+
## 3. Running the Docker Container
6668

6769
To run the `sim-ln` Docker container:
6870

@@ -95,7 +97,7 @@ For an interactive session:
9597
make run-interactive
9698
```
9799

98-
## Stopping the Container
100+
## 4. Stopping the Container
99101

100102
To stop the `sim-ln` Docker container, use:
101103

0 commit comments

Comments
 (0)