Skip to content

Commit 67a8827

Browse files
committed
docs: fix linter warnings
1 parent 286d9cf commit 67a8827

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

docs/containers.md

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Containers (Docker or Podman)
22

33
## Demo environment
4+
45
It is simple to setup the index with the default
56
configuration and run it using the pre-built public docker image:
67

7-
88
With Docker:
99

1010
```sh
@@ -17,11 +17,12 @@ or with Podman:
1717
podman run -it torrust/index:latest
1818
```
1919

20-
2120
## Requirements
21+
2222
- Tested with recent versions of Docker or Podman.
2323

2424
## Volumes
25+
2526
The [Containerfile](../Containerfile) (i.e. the Dockerfile) Defines Three Volumes:
2627

2728
```Dockerfile
@@ -38,19 +39,22 @@ When instancing the container image with the `docker run` or `podman run` comman
3839

3940
> NOTE: You can adjust this mapping for your preference, however this mapping is the default in our guides and scripts.
4041
41-
### Pre-Create Host-Mapped Folders:
42+
### Pre-Create Host-Mapped Folders
43+
4244
Please run this command where you wish to run the container:
4345

4446
```sh
4547
mkdir -p ./storage/index/lib/ ./storage/index/log/ ./storage/index/etc/
4648
```
4749

4850
### Matching Ownership ID's of Host Storage and Container Volumes
51+
4952
It is important that the `torrust` user has the same uid `$(id -u)` as the host mapped folders. In our [entry script](../share/container/entry_script_sh), installed to `/usr/local/bin/entry.sh` inside the container, switches to the `torrust` user created based upon the `USER_UID` environmental variable.
5053

5154
When running the container, you may use the `--env USER_ID="$(id -u)"` argument that gets the current user-id and passes to the container.
5255

5356
### Mapped Tree Structure
57+
5458
Using the standard mapping defined above produces this following mapped tree:
5559

5660
```s
@@ -78,6 +82,7 @@ git clone https://github.com/torrust/torrust-index.git; cd torrust-index
7882
```
7983

8084
### (Docker) Setup Context
85+
8186
Before starting, if you are using docker, it is helpful to reset the context to the default:
8287

8388
```sh
@@ -107,6 +112,7 @@ podman build --target debug --tag torrust-index:debug --file Containerfile .
107112
## Running the Container
108113

109114
### Basic Run
115+
110116
No arguments are needed for simply checking the container image works:
111117

112118
#### (Docker) Run Basic
@@ -118,6 +124,7 @@ docker run -it torrust-index:release
118124
# Debug Mode
119125
docker run -it torrust-index:debug
120126
```
127+
121128
#### (Podman) Run Basic
122129

123130
```sh
@@ -129,11 +136,13 @@ podman run -it torrust-index:debug
129136
```
130137

131138
### Arguments
139+
132140
The arguments need to be placed before the image tag. i.e.
133141

134142
`run [arguments] torrust-index:release`
135143

136144
#### Environmental Variables:
145+
137146
Environmental variables are loaded through the `--env`, in the format `--env VAR="value"`.
138147

139148
The following environmental variables can be set:
@@ -145,8 +154,8 @@ The following environmental variables can be set:
145154
- `USER_ID` - The user id for the runtime crated `torrust` user. Please Note: This user id should match the ownership of the host-mapped volumes, (default `1000`).
146155
- `API_PORT` - The port for the index API. This should match the port used in the configuration, (default `3001`).
147156

148-
149157
### Sockets
158+
150159
Socket ports used internally within the container can be mapped to with the `--publish` argument.
151160

152161
The format is: `--publish [optional_host_ip]:[host_port]:[container_port]/[optional_protocol]`, for example: `--publish 127.0.0.1:8080:80/tcp`.
@@ -159,8 +168,9 @@ The default ports can be mapped with the following:
159168

160169
> NOTE: Inside the container it is necessary to expose a socket with the wildcard address `0.0.0.0` so that it may be accessible from the host. Verify that the configuration that the sockets are wildcard.
161170
162-
### Volumes
163-
By default the container will use install volumes for `/var/lib/torrust/index`, `/var/log/torrust/index`, and `/etc/torrust/index`, however for better administration it good to make these volumes host-mapped.
171+
### Mapped Volumes
172+
173+
By default the container will install volumes for `/var/lib/torrust/index`, `/var/log/torrust/index`, and `/etc/torrust/index`, however for better administration it good to make these volumes host-mapped.
164174

165175
The argument to host-map volumes is `--volume`, with the format: `--volume=[host-src:]container-dest[:<options>]`.
166176

@@ -172,10 +182,9 @@ The default mapping can be supplied with the following arguments:
172182
--volume ./storage/index/etc:/etc/torrust/index:Z \
173183
```
174184

175-
176185
Please not the `:Z` at the end of the podman `--volume` mapping arguments, this is to give read-write permission on SELinux enabled systemd, if this doesn't work on your system, you can use `:rw` instead.
177186

178-
## Complete Example:
187+
## Complete Example
179188

180189
### With Docker
181190

0 commit comments

Comments
 (0)