Text on jinja code

Docker scripts for LinuxServer.io Docker containers

These script can be used to easily deploy LinuxServer.io Docker containers with predefined settings.

The scripts are based on data provided by the LinuxServer.io GitHub repositories.

Please keep the following in mind.

  • The scripts are not supported by LinuxServer.io
  • The scripts are being generated so I cannot accept requests to add scripts

Prerequisites

  • A server with Docker installed
  • Git installed

If you do not have Git installed, you can also download the ZIP from the GitHub repository.

Install the scripts

Git clone the repository (or download the ZIP from here).

git clone https://github.com/technorabilia/docker-bits.gitCode language: Bash (bash)

After cloning the repository, change the directory to lsio.

cd docker-bits/lsioCode language: Bash (bash)

There is one file and a bunch of directories available. One directory for each project.

docker-env.cfgCode language: Markdown (markdown)

If needed, adjust the base directory for your volume host directories, the Process User ID (PUID) and Process Group ID (PGID) and Timezone
(TZ). More information on PUID and PGID here.

After changing a variable you need to uncomment that line (remove the # at the beginning of the line). Note that the Docker scripts will default to the values below if they are not set.

#BASEDIR=/volume1/docker
#PUID=1024
#PGID=100
#TZ=Europe/AmsterdamCode language: Bash (bash)

Application list

All applications on https://fleet.linuxserver.io/ are available as a Docker script. At the time of writing, there are about 140+ applications in the LinuxServer.io fleet.

How to use the scripts

As an example we will have a look at the scripts for Sonarr.

After cloning the repository, change the directory to sonarr.

cd docker-bits/lsio/sonarrCode language: Bash (bash)

There are three files available.

run-once.sh
docker-compose.yaml
docker-run.shCode language: Markdown (markdown)

The script run-once.sh is used to link to the general settings in docker-env.cfg and create the volume host directories.

ln -s ../docker-env.cfg ./.env
source ./.env
mkdir -p ${BASEDIR:-/volume1/docker}/sonarr/config
mkdir -p ${BASEDIR:-/volume1/docker}/sonarr/tv
mkdir -p ${BASEDIR:-/volume1/docker}/sonarr/downloadsCode language: Bash (bash)

Run the script.

sh run-once.shCode language: Bash (bash)

As the name implies, you only have to do this once. You can delete the script if you want.

The docker-compose.yaml file can be used with docker-compose.

# Sonarr (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can
# monitor multiple RSS feeds for new episodes of your favorite shows and will
# grab, sort and rename them. It can also be configured to automatically upgrade
# the quality of files already downloaded when a better quality format becomes
# available.

---
version: "2.1"
services:
  sonarr:
    image: ghcr.io/linuxserver/sonarr
    container_name: sonarr
    environment:
      # for GroupID
      - PUID=${PUID:-1024}
      # for UserID
      - PGID=${PGID:-100}
      # Specify a timezone to use for example Europe/Amsterdam
      - TZ=${TZ:-Europe/Amsterdam}
    volumes:
      # Database and sonarr configs
      - ${BASEDIR:-/volume1/docker}/sonarr/config:/config
      # Location of TV library on disk (See note in Application setup)
      - ${BASEDIR:-/volume1/docker}/sonarr/tv:/tv
      # Location of download managers output directory (See note in Application setup)
      - ${BASEDIR:-/volume1/docker}/sonarr/downloads:/downloads
    ports:
      # The port for the Sonarr webinterface
      - 8989:8989
    restart: unless-stopped
Code language: YAML (yaml)

Start the container.

docker-compose up -dCode language: Bash (bash)

Docker-compose is the recommended way to start the container.

Next to docker-compose, you can also use the docker run command to start the container.

The docker-run.sh script is used for this.

# Sonarr (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can
# monitor multiple RSS feeds for new episodes of your favorite shows and will
# grab, sort and rename them. It can also be configured to automatically upgrade
# the quality of files already downloaded when a better quality format becomes
# available.

source ./.env
docker run -d \
  --name=sonarr \
  -e PUID=${PUID:-1024} `# for GroupID` \
  -e PGID=${PGID:-100} `# for UserID` \
  -e TZ=${TZ:-Europe/Amsterdam} `# Specify a timezone to use for example Europe/Amsterdam` \
  -p 8989:8989 `# The port for the Sonarr webinterface` \
  -v ${BASEDIR:-/volume1/docker}/sonarr/config:/config `# Database and sonarr configs` \
  -v ${BASEDIR:-/volume1/docker}/sonarr/tv:/tv `# Location of TV library on disk (See note in Application setup)` \
  -v ${BASEDIR:-/volume1/docker}/sonarr/downloads:/downloads `# Location of download managers output directory (See note in Application setup)` \
  --restart unless-stopped \
  ghcr.io/linuxserver/sonarrCode language: Bash (bash)

Start the container.

sh docker-run.shCode language: Bash (bash)

The scripts in action.


root@DS:~# cd ./docker-bits/lsio/sonarr
root@DS:~# sh run-once.sh
root@DS:~# docker-compose up -d
Creating network "sonarr_default" with the default driver
Creating sonarr ... done
root@DS:~# docker-compose down
Stopping sonarr ... done
Removing sonarr ... done
Removing network sonarr_default
root@DS:~# sh docker-run.sh
2d27e4520e57420c12742cbc152aa8bd849f82fcad6aa32bd77f1017f0e15f95
root@DS:~# docker stop sonarr
sonarr
root@DS:~# docker rm sonarr
sonarr
root@DS:~#Code language: Bash (bash)

Changes to the LinuxServer.io repository data

Because I am using a Synology NAS and for my own convenience, I made some minor changes to the LinuxServer.io data that is used for the scripts.

Volume host directories

Volume host directory information of LinuxServer.io is rewritten so that each individual volume path in the container will map to the following directory on the host.

/volume1/docker/{{ project_name }}/{{ volume_path}}

The default Synology Docker shared folder /volume1/docker is used as the base directory. You can change the directory or keep it and use a symbolic link to point to another location.

PUID and PGID

The default Synology admin user is used so the Process User ID (PUID) is 1024 and Process Group ID (PGID) is 100. More information on PUID and PGID here.

Timezone

Timezone (TZ) is set to Europe/Amsterdam.

Report issues

If you find a problem, you can submit it on GitHub. I will then look at it as soon as possible.

Considerations

  • With the default volume folder structure provided by LinuxServer.io you cannot use hard links. More information here.
  • The scripts are updated on a daily basis.

Credits

I would like to give a big thanks to LinuxServer.io for all their hard work! Without them this would not be possible.