GithubHelp home page GithubHelp logo

linuxserver / docker-mods Goto Github PK

View Code? Open in Web Editor NEW
957.0 23.0 252.0 3.81 MB

Documentation and Examples of base container modifications

License: GNU General Public License v3.0

Dockerfile 100.00%
hacktoberfest

docker-mods's Introduction

Intro

The purpose of the repository is to provide examples and guidance in creating and storing a user consumable modification layer for the Library of Linuxserver.io Containers. At it's core a Docker Mod is a tarball of files stored on Dockerhub and/or GitHub Container Registry that is downloaded and extracted on container boot before any init logic is run. This allows:

  • Developers and community users to modify base containers to suit their needs without the need to maintain a fork of the main docker repository
  • Mods to be shared with the Linuxserver.io userbase as individual independent projects with their own support channels and development ideologies
  • Zero cost hosting and build pipelines for these modifications leveraging GitHub Container Registry and Dockerhub
  • Full custom configuration management layers for hooking containers into each other using environment variables contained in a compose file

It is important to note to end users of this system that there are not only extreme security implications to consuming files from souces outside of our control, but by leveraging community Mods you essentially lose direct support from the core LinuxServer team. Our first and foremost troubleshooting step will be to remove the DOCKER_MODS environment variable when running into issues and replace the container with a clean LSIO one.

Again, when pulling in logic from external sources practice caution and trust the sources/community you get them from.

LinuxServer.io Hosted Mods

We host and publish official Mods at the linuxserver/mods endpoint as separate tags. Each tag is in the format of <imagename>-<modname> for the latest versions, and <imagename>-<modname>-<commitsha> for the specific versions.

Here's a list of the official Mods we host: https://mods.linuxserver.io/

Using a Docker Mod

Before consuming a Docker Mod ensure that the source code for it is publicly posted along with it's build pipeline pushing to Dockerhub.

Consumption of a Docker Mod is intended to be as user friendly as possible and can be achieved with the following environment variables being passed to the container:

  • DOCKER_MODS- This can be a single endpoint user/endpoint:tag or an array of endpoints separated by | user/endpoint:tag|user2/endpoint2:tag
  • RUN_BANNED_MODS- If this is set to any value you will bypass our centralized filter of banned Dockerhub users and run Mods regardless of a ban

Full example:

docker run

docker create \
  --name=nzbget \
  -e DOCKER_MODS=taisun/nzbget-mod:latest \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -p 6789:6789 \
  -v <path to data>:/config \
  -v <path/to/downloads>:/downloads \
  --restart unless-stopped \
  linuxserver/nzbget

docker compose

---
services:
  nzbget:
    image: linuxserver/nzbget:latest
    container_name: nzbget
    environment:
      - DOCKER_MODS=taisun/nzbget-mod:latest
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /path/to/data:/config
      - /path/to/downloads:/downloads #optional
    ports:
      - 6789:6789
    restart: unless-stopped

This will spinup an nzbget container and apply the custom logic found in the following repository:

https://github.com/Taisun-Docker/Linuxserver-Mod-Demo

This basic demo installs Pip and a couple dependencies for plugins some users leverage with nzbget.

Creating and maintaining a Docker Mod

We will always recommend to our users consuming Mods that they leverage ones from active community members or projects so transparency is key here. We understand that image layers can be pushed on the back end behind these pipelines, but every little bit helps. In this repository we will be going over two basic methods of making a Mod along with an example of the GitHub Actions build logic to get this into a Dockerhub and/or GitHub Container Registry endpoint. Though we are not officially endorsing GitHub Actions here it is built in to GitHub repositories and forks making it very easy to get started. If you prefer others feel free to use them as long as build jobs are transparent.

Note One of the core ideas to remember when creating a Mod is that it can only contain a single image layer, the examples below will show you how to add files standardly and how to run complex logic to assemble the files in a build layer to copy them over into this single layer.

Mod Types

We now only support s6 v3 mods. All currently supported Linuxserver base images are using s6 v3, however, older pinned images, forked versions, etc. may still be using v2. New mods will not work with older s6 v2 based images.

Docker Mod Simple - just add scripts

In this repository you will find the Dockerfile containing:

FROM scratch

# copy local files
COPY root/ /

For most users this will suffice and anything in the root/ folder of the repository will be added to the end users Docker container / path.

New (v3) mods

The most common paths to leverage for Linuxserver images are as follows. Assuming a mod name of universal-mymod:

.
└── root
  ├── defaults                                -- Any default config files you need to copy as part of the mod can be placed here
  └── etc
    └── s6-overlay
      └── s6-rc.d
        ├── init-mods-end
        │  └── dependencies.d
        │     └── init-mod-universal-mymod    -- If your mod does not need to install packages it should be a dependency of init-mods-end (empty file)
        ├── init-mods-package-install
        │  └── dependencies.d
        │     └── init-mod-universal-mymod    -- If your mod needs to install packages it should be a dependency of init-mods-package-install (empty file)
        ├── init-mod-universal-mymod
        │  ├── dependencies.d
        │  │  └── init-mods                   -- Tells our init logic that this depends on the `init-mods` step (empty file)
        │  ├── run                            -- This is the init logic script that runs before the services in the container. Use `chmod +x` to set proper permissions.
        │  ├── type                           -- This should contain the string `oneshot`.
        │  └── up                             -- This should contain the absolute path to `run` e.g. `/etc/s6-overlay/s6-rc.d/init-mod-universal-mymod/run`.
        ├── svc-mod-universal-mymod
        │  ├── dependencies.d
        │  │  └── init-services               -- Tells our init logic that this depends on the `init-services` step (empty file)
        │  ├── run                            -- This is the script that runs in the foreground for persistent services. Use `chmod +x` to set proper permissions.
        │  └── type                           -- This should contain the string `longrun`.
        └── user
          └── contents.d
            ├── init-mod-universal-mymod      -- Tells our init logic that we need this directory (empty file)
            └── svc-mod-universal-mymod       -- Tells our init logic that we need this directory (empty file)

Note For oneshot scripts you can alternatively omit the run file entirely and use the execlineb syntax in up if your requirements are simple enough.

Installing Packages

v3 mods make use of a single package install process for all mods to minimise the amount of calls to external endpoints and speed up the mod init process. If you need to install repo packages you should append them to /mod-repo-packages-to-install.list for repo packages or /mod-pip-packages-to-install.list for pip packages and the mod handler will install them for you. Make sure to handle both Ubuntu and Alpine package names if your mod needs to support both e.g.

#!/usr/bin/with-contenv bash

## Ubuntu
if [ -f /usr/bin/apt ]; then
    echo "\
        dnsutils \
        net-tools \
        iputils-ping \
        traceroute" >> /mod-repo-packages-to-install.list

fi
# Alpine
if [ -f /sbin/apk ]; then
    echo "\
        bind-tools \
        net-tools" >> /mod-repo-packages-to-install.list
fi

If your mod needs to take additional config steps after the packages have been installed, add a second oneshot script and make it depend on init-mods-package-install, add it as a dependency of init-mods-end, and add it to the content bundle e.g.

.
└── root
  └── etc
    └── s6-overlay
      └── s6-rc.d
        ├── init-mods-end
        │  └── dependencies.d
        │     └── init-mod-universal-mymod-postinstall
        ├── init-mod-universal-mymod-postinstall
        │  ├── dependencies.d
        │  │  └── init-mods-package-install
        │  ├── run
        │  ├── type
        │  └── up
        └── user
          └── contents.d
            └── init-mod-universal-mymod-postinstall

Services will always run last, controlled by their dependency on init-services.

Docker Mod Complex - Sky is the limit

In this repository you will find the Dockerfile.complex containing:

## Buildstage ##
FROM ghcr.io/linuxserver/baseimage-alpine:3.12 as buildstage

RUN \
  echo "**** install packages ****" && \
  apk add --no-cache \
    curl && \
  echo "**** grab rclone ****" && \
  mkdir -p /root-layer && \
  curl -o \
    /root-layer/rclone.deb -L \
    "https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-amd64.deb"

# copy local files
COPY root/ /root-layer/

## Single layer deployed image ##
FROM scratch

# Add files from buildstage
COPY --from=buildstage /root-layer/ /

Here we are leveraging a multi stage DockerFile to run custom logic and pull down an Rclone deb from the Internet to include in our image layer for distribution. Any amount of logic can be run in this build stage or even multiple build stages as long as the files in the end are combined into a single folder for the COPY command in the final output.

Getting a Mod to Dockerhub

To publish a Mod to DockerHub you will need the following accounts:

We recommend using this repository as a template for your first Mod, so in this section we assume the code is finished and we will only concentrate on plugging into GitHub Actions/Dockerhub.

The only code change you need to make to the build logic file .github/workflows/BuildImage.yml will be to modify the ENDPOINT to your own image:

  ENDPOINT: "user/endpoint"
  BRANCH: "master"

User is your Dockerhub user and endpoint is your own custom name (typically the name of the repository where your mod is). You do not need to create this endpoint beforehand, the build logic will push it and create it on first run.

Head over to https://github.com/user/endpoint/settings/secrets and click on New secret

Add DOCKERUSER (your DockerHub username) and DOCKERPASS (your DockerHub password or token).

You can create a token by visiting https://hub.docker.com/settings/security

GitHub Actions will trigger a build off of your repo when you commit. The image will be pushed to Dockerhub on success. This Dockerhub endpoint is the Mod variable you can use to customize your container now.

Getting a Mod to GitHub Container Registry

To publish a Mod to GitHub Container Registry you will need the following accounts:

We recommend using this repository as a template for your first Mod, so in this section we assume the code is finished and we will only concentrate on plugging into GitHub Actions/GitHub Container Registry.

The only code change you need to make to the build logic file .github/workflows/BuildImage.yml will be to modify the ENDPOINT to your own image:

  ENDPOINT: "user/endpoint"
  BRANCH: "master"

User is your GitHub user and endpoint is your own custom name (typically the name of the repository where your mod is). You do not need to create this endpoint beforehand, the build logic will push it and create it on first run.

Head over to https://github.com/user/endpoint/settings/secrets and click on New secret

Add CR_USER (your GitHub username) and CR_PAT (a personal access token with read:packages and write:packages scopes).

You can create a personal access token by visiting https://github.com/settings/tokens

GitHub Actions will trigger a build off of your repo when you commit. The image will be pushed to GitHub Container Registry on success. This GitHub Container Registry endpoint is the Mod variable you can use to customize your container now.

Submitting a PR for a Mod to be added to the official LinuxServer.io repo

  • Fork this repo, checkout the template branch.
  • Edit the Dockerfile for the mod. Dockerfile.complex is only an example and included for reference; it should be deleted when done.
  • Inspect the root folder contents. Edit, add and remove as necessary.
  • After all init scripts and services are created, run find ./ -path "./.git" -prune -o ( -name "run" -o -name "finish" -o -name "check" ) -not -perm -u=x,g=x,o=x -print -exec chmod +x {} + to fix permissions.
  • Edit the readme with pertinent info.
  • Finally edit the .github/workflows/BuildImage.yml. Customize the vars for BASEIMAGE and MODNAME. Set the versioning logic and MULTI_ARCH if needed.
  • Ask the team to create a new branch named <baseimagename>-<modname> in this repo. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the template branch.
  • Submit PR against the branch created by the team.
  • Make sure that the commits in the PR are squashed.
  • Also make sure that the commit and PR titles are in the format of <imagename>: <modname> <very brief description like "initial release" or "update">. Detailed description and further info should be provided in the body (ie. code-server: python2 add python-pip).

Appendix

File encoding

s6 init files must be encoded in plain UTF-8, and not UTF-8 with BOM. You can remove the BOM using your IDE if necessary.

Inspecting mods

To inspect the file contents of external Mods dive is a great CLI tool:

https://github.com/wagoodman/dive

Basic usage:

Unix w/ Docker

docker run --rm -it \
    -v /var/run/docker.sock:/var/run/docker.sock \
    wagoodman/dive:latest <Image Name>

w/o Docker

dive <Image Name>

docker-mods's People

Contributors

aptalca avatar chbmb avatar drizuid avatar j0nnymoe avatar lukasdotcom avatar nemchik avatar reenignearcher avatar roxedus avatar schmittyd avatar thelamer avatar thespad avatar thom-x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-mods's Issues

Hugo Mod

Please create a branch for code-server-hugo that I can create a Hugo mod for code-server.

cloudflare-real-ip - ipv4 and ipv6 combined

I'm using linuxserver/mods:swag-cloudflare-real-ip and after a restart of SWAG docker in UNRAID, the last line of Cloudflare ipv4 is combined with the ipv6 in the cf_real-ip.conf file. This would cause SWAG not to load properly. Any idea what's causing this?

set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/222400:cb00::/32;
set_real_ip_from 2606:4700::/32;

CODESERVER - PowerShellMOD

Hello Everyone,
I would like to ask if it were possible to get a PowerShell mod.
I like your job with CodeServer much - and since I use VSCode for Powershell scripts - it would be wonderful if someone could add this mod :-)

Thank you very much.

Question re: Mesa libraries and libva

Hi,

Thanks for creating the mod to get this working with Renoir GPU's. I'm trying to get this working also with Frigate and have added the mesa ppa to a seaprate Ubuntu 20.04 container but am not getting any transcoding via VAAPI working. I know Jellyfin is using libava 2.11 but I can't find these packages in any other PPA. Can you point me to where you got these and anything else you changed to get VAAPI working?

Any pointers would be very appreciated.

OCR languages missing in papermerge

Hi,

i tried to run papermerge today, using:

docker run -d
-p 8000:8000
-v /docker/papermerge/config:/config
-v /docker/papermerge/data:/data
-e PUID=1000
-e PGID=1000
-e TZ="Europe/Lisbon"
-e DOCKER_MODS="linuxserver/mods:papermerge-multilangocr" \
-e OCRLANG="por"
--restart always
--name=papermerge
lscr.io/linuxserver/papermerge:latest

but in the OCR languages list the only language that appears is English.
What am i missing? Is there a problem with the mod?

Thanks

Java Mod

Hi,
I'm developing a Java Code Server Mod. My first idea is to create multiple versions (just one branch like code-server-go mod), i.e. code-server-java-8, code-server-java-11, etc and use alternative (url as a mean to change the version. In this way, one could install multiple mod and switch between versions if needed.
What do you think?

Flavio

Applying mod to nginx image fails

Applying a mod to the nginx image fails with:

nginx        | [mod-init] Attempting to run Docker Modification Logic
nginx        | [mod-init] Applying pagdot/nginx-reverse-mod files to container
nginx        | tar: invalid magic
nginx        | tar: short read

According to a question on unix stackexchange the tar binary from alpines busybox doesn"t support a necessary feature

[Swag-cloudflare-realip] Mod kills container if it cannot access Cloudflare

This mod accesses cloudflare's IP page and places them into a file. However, in my case, sometimes my DNS server is not up by the time the Swag container spins up (even if I set Swag to depend on my DNS container). Since this mod runs right away on startup, there is not a huge gap to allow the DNS container to fully spin up.

If it fails to access the website due to DNS resolution errors, it does not actually list out any IPs, and the created file creates a fatal error in nginx -- nginx: [emerg] invalid number of arguments in "set_real_ip_from" directive in /config/nginx/cf_real-ip.conf:1.

Ideally, the mod should be able to retry access to the CF page if inaccessible, and maybe if it still cannot access it after a sane number of retries, it has a proper fallback that does not brick the entire container.

tesseract languages in papermerge-multilangocr don't install

Hi guys,

Thanks for creating the papermerge-multilangocr mod, it's exactly what I need to process mainly non-english documents.

However, when starting the container, it seems that the tesseract-lang files are not getting installed. Trying to install language support for German, English and Spanish, the log reads:

papermerge       | 2021-01-12T08:36:39.420992960Z package tesseract-ocr-"deu not found in the repository, skipping
papermerge       | 2021-01-12T08:36:43.833110801Z installing tesseract-ocr-eng
papermerge       | 2021-01-12T08:36:50.575252549Z tesseract-ocr-eng is already the newest version (1:4.00~git30-7274cfa-1).
papermerge       | 2021-01-12T08:36:54.855432077Z package tesseract-ocr-esp" not found in the repository, skipping

My docker-compose.yaml looks like this:

papermerge:
    image: ghcr.io/linuxserver/papermerge
    container_name: papermerge
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - DOCKER_MODS=linuxserver/mods:papermerge-multilangocr
      - OCRLANG="eng,deu,esp"
    volumes:
      - <omitted>:/config
      - <omitted>:/data
    ports:
      - 8000:8000
    restart: unless-stopped

And my papermerge.conf.py:

DBUSER = "root"
DBPASS = "root"
DBHOST = "mariadb"
DBNAME = "papermerge"

MEDIA_DIR = "/data/media"
STATIC_DIR = "/app/papermerge/static"
MEDIA_URL = "/media/"
STATIC_URL = "/static/"
IMPORTER_DIR = "/data/import"

OCR_DEFAULT_LANGUAGE = "deu"

OCR_LANGUAGES = {
    "eng": "English",
    "esp": "Spanish",
    "deu": "Deutsch",
}

Is this a bug or did I do something wrong?

Workflow issue: Actions `Tag image` thru `Push tags to DockerHub` are Ignored

Ref: https://github.com/shaneholloman/docker-mods/actions

Workflow Issue:

Actions Tag image thru Push tags to DockerHub are Ignored

I have:

  • added the DockerHub and Github secrets for pushes
  • and followed instruction to change the endpoint as stated here:

The only code change you need to make to the build logic file .github/workflows/BuildImage.yml will be to modify the ENDPOINT to your own image:

  ENDPOINT: "shaneholloman/endpoint-mod"
  BRANCH: "master"

Nothing fails:
But, the actions after Build image up to Post Run actions/[email protected] are ignored and not executed

[FR] swag auto-proxy: Add label to override preset

Add following label:

  • swag_address=containername - optional - overrides swag config preset. Defaults to container name.

I'm thinking about giving auto-proxy a try and could maybe implement this myself

radarr: striptracks

I created PR #72 for this mod. Hopefully I did that right.
Also, not sure how to handle the fact that the mod works in both Radarr and Sonarr containers.

Issue with Docker Hub API rate limits

Since Docker Hub now applies more aggressive rate limiting, applying docker mods can fail, even if using ghcr.io, because of the API call(s) to Docker Hub's API.

Are there currently any plans or work being done regarding this? As I'm not sure if the plan is to move entirely to ghcr.io, or keep using/supporting both registries?

One way to potentially solve this would be to expose an env var to override the token used for authentication, as the "anonymous" token is very easily rate limited and there's currently no error handling in place to even detect this.

Problem in linuxserver image relative to token from dockerhub

There is a problem nowadays to retrieve token from dockerhub.
Something change and there is now a missing grep.

There is a missing grep in the curl instruction to retrieve the token from DockerHub
because the curl request return 4 fields

curl     --silent     --header 'GET'     "${AUTH_URL}"
{
 "token": "....",
 "access_token": "...",
 "expires_in": 300,
 "issued_at": "2021-05-07T02:42:01.633778362Z"
}

I have opened a PR in ubuntu base image, but i am not sure this was the right place where you centralized docker-mods script

linuxserver/docker-baseimage-ubuntu#69

Geoip2Influx Mod: TypeError: “NetworkError when attempting to fetch resource.”

Lately, the influxdb image has been updated to version 2.

Users need to revert back to influxdb 1.8 for the database to work.

However, even after I reverted, the grafana map shows TypeError: “NetworkError when attempting to fetch resource.” for the sections of Geoip2Influx Mod. It's weird because my Telegraf status are showing properly.

code-server-docker erroneous error message

I added code-server-docker mod to the linuxserver/duplicati container. Docker logs for duplicati shows the following error message:

**** Please map /var/run/docker.sock or docker won't work inside this container ****

This should not be an error. I am using tecnativa/docker-socket-proxy and I set the DOCKER_HOST environment variable, as per the Docker Command Line documentation. Docker inside the container is running just fine. The mod should check if DOCKER_HOST is set or if /var/run/docker.sock is mapped before issuing an error message.

awscli for code server

Hi,
I have written a mod that will install the aws cli

would it be possible to get a branch created called code-server-awscli

regards,
Chris

[FR] Mods to set default auth for all sample

It would be great to have a mod for each type of auth who when enabled would uncomment the line for this auth method insise all the sample

Or a unique mod with an environment variable to get the auth mode choosen.

only amd64?

Is there a technical reason that docker-mods only work on amd64, or is there a chance that some of them will be made available for arm? In particular, it'd be good to get the lazylibrarian-ffmpeg mod to work with lazylibrarian-arm...

Thanks

Cutover from Dockerhub

We need to change docs to reflect we recommend using github as a mod endpoint. Also need to change the endpoints in the baseimages to do some auto detection if starts with linuxserver in the string hit github.

imagemagick docker mod for swag

When adding the imagemagick docker mod to swag (I'm on Unraid), I get the following error in the swag docker log

[cont-init.d] 98-imagemagick: executing...
**** installing imagemagick ****
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
so:libMagickCore-7.Q16HDRI.so.8 (no such package):
required by: php7-pecl-imagick-3.4.4-r7[so:libMagickCore-7.Q16HDRI.so.8]
so:libMagickWand-7.Q16HDRI.so.8 (no such package):
required by: php7-pecl-imagick-3.4.4-r7[so:libMagickWand-7.Q16HDRI.so.8]
[cont-init.d] 98-imagemagick: exited 3.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

MariaDB Mod for Papermerge

Can you please create a branch called papermerge-mariadb to develop a Mod that adds libmariadb-dev package?

code-server-golang

I've created a golang mod for code-server that I'd like to send a PR for.

Please create a new branch for me to send you a PR.

My repo is located at https://github.com/n-i-x/codeserver-golang-mod and currently published to nixapps/codeserver-golang:latest

There seems to be a code-server bug where the initial terminal doesn't have its PATH set properly, but opening a new one does so I'm not sure what to do about that aside from opening up an issue with code-server.

GeoIP mod: Log full of these warnings

Is this ok to see in the logs? If so, is there some way to silence them so they don't keep cluttering the logs? If not ok, how can I fix it?

Warnings (a bunch of : WARNING :: Failed to match regex that previously matched!? Skipping this line!):

https://pastebin.com/X9CaZw38

Here's my nginx.conf:

## Version 2020/09/01 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx.conf

user abc;
worker_processes 4;
pid /run/nginx.pid;
include /etc/nginx/modules/*.conf;

events {
	worker_connections 768;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	variables_hash_max_size 2048;
	large_client_header_buffers 4 16k;

	client_max_body_size 0;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

    log_format geoip2influx '$remote_addr - $remote_user[$time_local]'
           '"$request" $status $body_bytes_sent'
           '"$http_referer" $host "$http_user_agent"'
           '"$request_time" "$upstream_connect_time"'
           '"$geoip2_data_city_name" "$geoip2_data_country_iso_code"';

	##
	# Logging Settings
	##

	access_log /config/log/nginx/access.log geoip2influx;
	error_log /config/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	##
	# WebSocket proxying
	##
	map $http_upgrade $connection_upgrade {
		default upgrade;
		''      close;
	}

	##
	# Virtual Host Configs
	##
	include /etc/nginx/conf.d/*.conf;
	include /config/nginx/site-confs/*;

	##
	# Geoip2 config
	##
	# Uncomment to add the Geoip2 configs needed to geo block countries/cities.
	##
	include /config/nginx/geoip2.conf;
}

daemon off;

here's my compose:

  swag:
    image: ghcr.io/linuxserver/swag:latest
    environment:
      - TZ=America/Chicago
      - "URL=domain.rocks"
      - 'SUBDOMAINS=bitwarden,gotify,grafana,nextcloud,mydomain,openhab,plex,prometheus,resilio-sync,sourcegraph,syncthing,wallabag'
      - PUID=1000
      - PGID=1000
      - VALIDATION=dns
      - ONLY_SUBDOMAINS=true
      - DNSPLUGIN=cloudflare
      - "MAXMINDDB_LICENSE_KEY=redacted"
      - DOCKER_MODS=linuxserver/mods:swag-ffmpeg|linuxserver/mods:swag-imagemagick|linuxserver/mods:swag-geoip2influx
      - INFLUX_HOST=influxdb
      - INFLUX_DATABASE=nginx
      - GEOIP2INFLUX_LOG_LEVEL=info
    volumes:
      - /opt/docker/configs/Swag/config:/config:rw
      - /opt/docker/logs/swag:/config/log:rw 
      - /opt/docker/configs/Swag/.bashrc:/root/.bashrc:rw
      - /etc/localtime:/etc/localtime:ro
    ports:
      - 9999:443
    deploy:
      mode: global
      restart_policy:
        condition: any
    networks:
      - oc

How to enable PHP extensions

I am trying to run a Laravel 8 project in the code server, but I am not able to install my composer dependencies, because I need extensions like mbstring. How can I install the required extensions and keep them after a restart of the container?

Obsolete build

In swag, lua was removed 6 days ago in commit 479ee5eac1b23da26881cdc78918b7691bd5e2b2.

I'm using linuxserver/nginx:latest with DOCKER_MODS=linuxserver/mods:nginx-proxy-confs and I'm getting error:
nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88

The linuxserver/nginx container's /defaults/nginx.conf is up to date with lua removed, so the problem is with the mod.
Is the mod out of sync with this change?

P.S.: I know I can manually remove lua from /config/nginx/nginx.conf but the point of these containers is to work out of the box...

Startup log:

[mod-init] Attempting to run Docker Modification Logic
[mod-init] Applying linuxserver/mods:nginx-proxy-confs files to container
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
chown: changing ownership of '/config/nginx/.htpasswd': Read-only file system
chown: changing ownership of '/config/nginx/site-confs/default': Read-only file system
chown: changing ownership of '/config/www/pse/error/403.html': Read-only file system
chown: changing ownership of '/config/www/pse/error/404.html': Read-only file system
chown: changing ownership of '/config/www/pse/error/5xx.html': Read-only file system
chown: changing ownership of '/config/www/pse/error': Read-only file system
chown: changing ownership of '/config/www/pse': Read-only file system
chmod: changing permissions of '/config/nginx/.htpasswd': Read-only file system
chmod: changing permissions of '/config/nginx/site-confs/default': Read-only file system
chmod: changing permissions of '/config/www/pse': Read-only file system
chmod: changing permissions of '/config/www/pse/error': Read-only file system
chmod: changing permissions of '/config/www/pse/error/403.html': Read-only file system
chmod: changing permissions of '/config/www/pse/error/404.html': Read-only file system
chmod: changing permissions of '/config/www/pse/error/5xx.html': Read-only file system
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
..............+++++
...........................................................+++++
writing new private key to '/config/keys/cert.key'
-----
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
Removing lua specific info from nginx.conf
Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please manually download/update the GeoIP2 db and save as /config/geoip2db/GeoLite2-City.mmdb
[cont-init.d] 40-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] 99-proxy-conf: executing...
grep: /config/nginx/dhparams.pem: No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   769  100   769    0     0   3610      0 --:--:-- --:--:-- --:--:--  3610
[cont-init.d] 99-proxy-conf: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
nginx: [emerg] unknown directive "lua_load_resty_core" in /config/nginx/nginx.conf:88

Crontab mod - invoke-rc.d: policy-rc.d denied execution of start.

Maybe a the 5th of February the crontab mod stopped working on my containers. In that time I have made no changes to my Docker Compose files.

I am running a docker swarm with the crontab mod installed on Radarr, Lidarr and Sonarr.

I have the container running as a non privileged user.

I get the following output:

-------------------------------------
GID/UID
-------------------------------------
User uid:    1000
User gid:    1000
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 95-cron: executing...
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
<<TRIMMED>>
Get:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [663 kB]
Fetched 31.4 MB in 3s (12.4 MB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  anacron logrotate checksecurity default-mta | mail-transport-agent
The following NEW packages will be installed:
  cron
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 71.5 kB of archives.
After this operation, 268 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 cron amd64 3.0pl1-136ubuntu1 [71.5 kB]
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 1.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7, <> line 1.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
Fetched 71.5 kB in 0s (609 kB/s)
Selecting previously unselected package cron.
(Reading database ... 
(Reading database ... 5%
<<TRIMMED>>
(Reading database ... 100%
(Reading database ... 7538 files and directories currently installed.)
Preparing to unpack .../cron_3.0pl1-136ubuntu1_amd64.deb ...
Unpacking cron (3.0pl1-136ubuntu1) ...
Setting up cron (3.0pl1-136ubuntu1) ...
Adding group `crontab' (GID 101) ...
Done.
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
[cont-init.d] 95-cron: exited 0.

Wrong time shown if f2b Discord mod?

I tested the mods:swag-f2bdiscord for the Swag Docker, and got this message in my Discord:
"XXX.XXX.XXX.XXX got banned for 3600 hours after 4 tries."
The jail.local has this setting:

"bantime" is the number of seconds that a host is banned.

bantime = 3600

So shouldn't the mods:swag-f2bdiscord report the time as "3600 seconds" instead of "3600 hours"?

[radarr-striptracks] Unable to test/save script with Sonarr v3 (works with Radarr v3)

Sonarr v3.0.4.1098-ls47 by linuxserver.io
Radarr v3.0.1.4259-ls92 by linuxserver.io

When creating a custom script in Sonarr with Settings->Connect, the Test button loads indefinitely. The Save button has the same behaviour. It works like a charm with Radarr, same settings.

I'm calling /usr/local/bin/striptracks-eng-fre.sh. Content below:

#!/bin/bash
. /usr/local/bin/striptracks.sh :eng:fre:und :eng:fre

swag-auto-reload mod:

Attempted to add the mod and I'm getting

./run: line 30: inotifywait: command not found

Multi-arch mods?

I'm the maintainer of the radarr-striptracks mod. I also have an as yet unsubmitted mod called lidarr-flac2mp3 that I had a user request an ARM build for. I managed to get it working with Travis CI and it was easy enough I thought I'd ask if there is any interest in multi-arch builds in general.

You can check out the .travis.yml and the Dockerfile.arm64 that make it work (though I'm probably preaching to the choir 😉).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.