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
Copy file name to clipboardexpand all lines: README.md
+24-18
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,15 @@ This allows:
9
9
* Zero cost hosting and build pipelines for these modifications leveraging GitHub Container Registry and Dockerhub
10
10
* Full custom configuration management layers for hooking containers into each other using environment variables contained in a compose file
11
11
12
-
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.
12
+
It is important to note to end users of this system that there are not only extreme security implications to consuming files from sources 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.
13
13
14
14
Again, when pulling in logic from external sources practice caution and trust the sources/community you get them from.
15
15
16
16
## LinuxServer.io Hosted Mods
17
17
18
18
We host and publish official Mods at the [linuxserver/mods](https://github.com/orgs/linuxserver/packages/container/mods/versions) 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.
19
19
20
-
Here's a list of the official Mods we host: <https://mods.linuxserver.io/>
20
+
Here's a list of the official Mods we host: [https://mods.linuxserver.io/](https://mods.linuxserver.io/)
21
21
22
22
## Using a Docker Mod
23
23
@@ -31,6 +31,7 @@ Consumption of a Docker Mod is intended to be as user friendly as possible and c
31
31
Full example:
32
32
33
33
docker run
34
+
34
35
```bash
35
36
docker create \
36
37
--name=nzbget \
@@ -44,7 +45,9 @@ docker create \
44
45
--restart unless-stopped \
45
46
linuxserver/nzbget
46
47
```
48
+
47
49
docker compose
50
+
48
51
```yaml
49
52
---
50
53
services:
@@ -64,16 +67,17 @@ services:
64
67
restart: unless-stopped
65
68
```
66
69
67
-
This will spinup an nzbget container and apply the custom logic found in the following repository:
70
+
This will spin up an nzbget container and apply the custom logic found in the following repository:
This basic demo installs Pip and a couple dependencies for plugins some users leverage with nzbget.
72
75
73
76
## Creating and maintaining a Docker Mod
74
77
75
-
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.
76
-
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.
78
+
**All of the example files referenced in this section are available in the [template](https://github.com/linuxserver/docker-mods/tree/template) branch of this repo.**
79
+
80
+
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.
77
81
78
82
> **Note**
79
83
> 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.
@@ -186,7 +190,7 @@ In this repository you will find the `Dockerfile.complex` containing:
186
190
187
191
```Dockerfile
188
192
## Buildstage ##
189
-
FROM ghcr.io/linuxserver/baseimage-alpine:3.12 as buildstage
193
+
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as buildstage
190
194
191
195
RUN \
192
196
echo "**** install packages ****" && \
@@ -208,14 +212,14 @@ FROM scratch
208
212
COPY --from=buildstage /root-layer/ /
209
213
```
210
214
211
-
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.
215
+
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.
212
216
213
217
## Getting a Mod to Dockerhub
214
218
215
219
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.
221
225
@@ -232,15 +236,15 @@ Head over to `https://github.com/user/endpoint/settings/secrets` and click on `N
232
236
233
237
Add `DOCKERUSER` (your DockerHub username) and `DOCKERPASS` (your DockerHub password or token).
234
238
235
-
You can create a token by visiting <https://hub.docker.com/settings/security>
239
+
You can create a token by visiting [https://hub.docker.com/settings/security](https://hub.docker.com/settings/security)
236
240
237
241
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.
238
242
239
243
## Getting a Mod to GitHub Container Registry
240
244
241
245
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.
246
250
@@ -251,13 +255,13 @@ The only code change you need to make to the build logic file `.github/workflows
251
255
BRANCH: "master"
252
256
```
253
257
254
-
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.
258
+
`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.
255
259
256
-
Head over to `https://github.com/user/endpoint/settings/secrets` and click on `New secret`
260
+
Head over to `https://github.com/<user>/<endpoint>/settings/secrets` and click on `New secret`
257
261
258
262
Add `CR_USER` (your GitHub username) and `CR_PAT` (a personal access token with `read:packages` and `write:packages` scopes).
259
263
260
-
You can create a personal access token by visiting <https://github.com/settings/tokens>
264
+
You can create a personal access token by visiting [https://github.com/settings/tokens](https://github.com/settings/tokens)
261
265
262
266
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.
263
267
@@ -284,18 +288,20 @@ s6 init files must be encoded in plain `UTF-8`, and not `UTF-8 with BOM`. You ca
284
288
285
289
To inspect the file contents of external Mods dive is a great CLI tool:
0 commit comments