You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docker/README.md
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This guide provides instructions on how to build, run, and manage the `sim-ln` D
7
7
- Docker installed on your machine.
8
8
- A `sim.json` file that contains your specific configuration.
9
9
10
-
## Building the Docker Image
10
+
## 1. Building the Docker Image
11
11
12
12
To build the Docker image, execute:
13
13
@@ -17,7 +17,7 @@ make build-docker
17
17
18
18
This command will make the necessary preparations and build the Docker image.
19
19
20
-
## Mounting the Volume
20
+
## 2. Mounting the Volume
21
21
22
22
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.
23
23
@@ -30,6 +30,7 @@ make mount-volume SIMFILE_PATH=/path/to/your/sim.json
30
30
Replace `/path/to/your/sim.json` with the actual path to your `sim.json` file.
31
31
32
32
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.
33
34
34
35
*Note:* The path to your config must be an absolute path not relative e.g. "/Users/anonymous/bitcoin-dev-project/sim-ln/sim.json"
35
36
@@ -40,12 +41,14 @@ If you're running nodes on a remote machine, or if you have a more complex setup
40
41
1. Create a Docker volume named simln-data.
41
42
2. Copy your configuration, certificates, macaroons, etc., to the volume.
42
43
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.
43
45
44
-
---
46
+
<details>
47
+
<summary>Tip: Using host.docker.internal</summary>
45
48
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.
47
50
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.
49
52
50
53
For instance, in your configuration:
51
54
@@ -59,10 +62,9 @@ For instance, in your configuration:
59
62
```
60
63
61
64
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.
0 commit comments