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
### Matching Ownership ID's of Host Storage and Container Volumes
51
+
49
52
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.
50
53
51
54
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.
52
55
53
56
### Mapped Tree Structure
57
+
54
58
Using the standard mapping defined above produces this following mapped tree:
55
59
56
60
```s
@@ -78,6 +82,7 @@ git clone https://github.com/torrust/torrust-index.git; cd torrust-index
78
82
```
79
83
80
84
### (Docker) Setup Context
85
+
81
86
Before starting, if you are using docker, it is helpful to reset the context to the default:
No arguments are needed for simply checking the container image works:
111
117
112
118
#### (Docker) Run Basic
@@ -118,6 +124,7 @@ docker run -it torrust-index:release
118
124
# Debug Mode
119
125
docker run -it torrust-index:debug
120
126
```
127
+
121
128
#### (Podman) Run Basic
122
129
123
130
```sh
@@ -129,11 +136,13 @@ podman run -it torrust-index:debug
129
136
```
130
137
131
138
### Arguments
139
+
132
140
The arguments need to be placed before the image tag. i.e.
133
141
134
142
`run [arguments] torrust-index:release`
135
143
136
144
#### Environmental Variables:
145
+
137
146
Environmental variables are loaded through the `--env`, in the format `--env VAR="value"`.
138
147
139
148
The following environmental variables can be set:
@@ -145,8 +154,8 @@ The following environmental variables can be set:
145
154
-`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`).
146
155
-`API_PORT` - The port for the index API. This should match the port used in the configuration, (default `3001`).
147
156
148
-
149
157
### Sockets
158
+
150
159
Socket ports used internally within the container can be mapped to with the `--publish` argument.
151
160
152
161
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:
159
168
160
169
> 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.
161
170
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.
164
174
165
175
The argument to host-map volumes is `--volume`, with the format: `--volume=[host-src:]container-dest[:<options>]`.
166
176
@@ -172,10 +182,9 @@ The default mapping can be supplied with the following arguments:
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.
0 commit comments