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
[](https://blog.linuxserver.io"all the things you can do with our containers including How-To guides, opinions and much more!")
Here are some example snippets to help you get started creating a container.
127
+
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
129
128
130
129
### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose))
131
130
@@ -169,12 +168,11 @@ docker run -d \
169
168
-v path_to_data:/config \
170
169
--restart unless-stopped \
171
170
lscr.io/linuxserver/mariadb:latest
172
-
173
171
```
174
172
175
173
## Parameters
176
174
177
-
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
175
+
Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
178
176
179
177
| Parameter | Function |
180
178
| :----: | --- |
@@ -196,10 +194,10 @@ You can set any environment variable from a file by using a special prepend `FIL
196
194
As an example:
197
195
198
196
```bash
199
-
-e FILE__PASSWORD=/run/secrets/mysecretpassword
197
+
-e FILE__MYVAR=/run/secrets/mysecretvariable
200
198
```
201
199
202
-
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
200
+
Will set the environment variable `MYVAR` based on the contents of the `/run/secrets/mysecretvariable` file.
203
201
204
202
## Umask for running applications
205
203
@@ -208,15 +206,20 @@ Keep in mind umask is not chmod it subtracts from permissions based on it's valu
208
206
209
207
## User / Group Identifiers
210
208
211
-
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
209
+
When using volumes (`-v` flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
212
210
213
211
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
214
212
215
-
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
213
+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id your_user` as below:
@@ -227,12 +230,29 @@ We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to
227
230
228
231
## Support Info
229
232
230
-
* Shell access whilst the container is running: `docker exec -it mariadb /bin/bash`
231
-
* To monitor the logs of the container in realtime: `docker logs -f mariadb`
232
-
* container version number
233
-
*`docker inspect -f '{{ index .Config.Labels "build_version" }}' mariadb`
234
-
* image version number
235
-
*`docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/mariadb:latest`
233
+
* Shell access whilst the container is running:
234
+
235
+
```bash
236
+
docker exec -it mariadb /bin/bash
237
+
```
238
+
239
+
* To monitor the logs of the container in realtime:
240
+
241
+
```bash
242
+
docker logs -f mariadb
243
+
```
244
+
245
+
* Container version number:
246
+
247
+
```bash
248
+
docker inspect -f '{{ index .Config.Labels "build_version" }}' mariadb
249
+
```
250
+
251
+
* Image version number:
252
+
253
+
```bash
254
+
docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/mariadb:latest
255
+
```
236
256
237
257
## Updating Info
238
258
@@ -242,38 +262,83 @@ Below are the instructions for updating containers:
242
262
243
263
### Via Docker Compose
244
264
245
-
* Update all images: `docker-compose pull`
246
-
* or update a single image: `docker-compose pull mariadb`
247
-
* Let compose update all containers as necessary: `docker-compose up -d`
248
-
* or update a single container: `docker-compose up -d mariadb`
249
-
* You can also remove the old dangling images: `docker image prune`
265
+
* Update images:
266
+
* All images:
267
+
268
+
```bash
269
+
docker-compose pull
270
+
```
271
+
272
+
* Single image:
273
+
274
+
```bash
275
+
docker-compose pull mariadb
276
+
```
277
+
278
+
* Update containers:
279
+
* All containers:
280
+
281
+
```bash
282
+
docker-compose up -d
283
+
```
284
+
285
+
* Single container:
286
+
287
+
```bash
288
+
docker-compose up -d mariadb
289
+
```
290
+
291
+
* You can also remove the old dangling images:
292
+
293
+
```bash
294
+
docker image prune
295
+
```
250
296
251
297
### Via Docker Run
252
298
253
-
* Update the image: `docker pull lscr.io/linuxserver/mariadb:latest`
254
-
* Stop the running container: `docker stop mariadb`
255
-
* Delete the container: `docker rm mariadb`
299
+
* Update the image:
300
+
301
+
```bash
302
+
docker pull lscr.io/linuxserver/mariadb:latest
303
+
```
304
+
305
+
* Stop the running container:
306
+
307
+
```bash
308
+
docker stop mariadb
309
+
```
310
+
311
+
* Delete the container:
312
+
313
+
```bash
314
+
docker rm mariadb
315
+
```
316
+
256
317
* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved)
257
-
* You can also remove the old dangling images: `docker image prune`
318
+
* You can also remove the old dangling images:
319
+
320
+
```bash
321
+
docker image prune
322
+
```
258
323
259
324
### Via Watchtower auto-updater (only use if you don't remember the original parameters)
260
325
261
326
* Pull the latest image at its tag and replace it with the same env variables in one run:
262
327
263
-
```bash
264
-
docker run --rm \
265
-
-v /var/run/docker.sock:/var/run/docker.sock \
266
-
containrrr/watchtower \
267
-
--run-once mariadb
268
-
```
328
+
```bash
329
+
docker run --rm \
330
+
-v /var/run/docker.sock:/var/run/docker.sock \
331
+
containrrr/watchtower \
332
+
--run-once mariadb
333
+
```
269
334
270
335
* You can also remove the old dangling images: `docker image prune`
271
336
272
-
**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
337
+
**warning**: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
341
+
**tip**: We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
0 commit comments