From 9bb12ea879a11769c82ee2d415cc8e4406565ebf Mon Sep 17 00:00:00 2001 From: Josh Stark Date: Thu, 24 Jan 2019 20:21:45 +0000 Subject: [PATCH] Create running-our-containers.md --- general/running-our-containers.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 general/running-our-containers.md diff --git a/general/running-our-containers.md b/general/running-our-containers.md new file mode 100644 index 000000000..5aa584df5 --- /dev/null +++ b/general/running-our-containers.md @@ -0,0 +1,30 @@ +# Running LinuxServer Containers + +## Image Structure + +### Base Images + +We have curated various base images which our main application images derive from. This is beneficial for two main reasons: + +- A common dependency base between multiple images, reducing the likelihood of variation between two or more applications that share the same dependencies. +- Reduction in image footprint on your host machine by fully utilising Docker's image layering system. Multiple containers running locally that share the same base image will reuse that image and any of its ancestors. + +### The `/config` volume + +To help reduce variation between our images, we have adopted a common structure pattern for application config and dependent directories. This means that each image has its own internal `/config` directory which holds all application-specific configuration. With the exception of a small number of images, all of our images expose this volume. + +We do this because we believe that it makes it easier to answer the common question of "where does the application data get persisted?" - the answer being "always in `/config`". If you don't map this directory when creating your containers, the config will only last as long as the lifespan of the container itself! + +## Creating a Container + +To create a container from one of our images, you must use either `docker create` or `docker run`. Each image follows the same pattern in the command when creating a container: + +```bash +docker create \ + --name= \ + -v :/config \ + -e PUID= \ + -e PGID= \ + -p : \ + linuxserver/ +```