Skip to content

Commit aa121cc

Browse files
authored
Merge pull request #1152 from hatchmt/netbox-dns
netbox: dns initial release
2 parents 6360fcf + 139417d commit aa121cc

22 files changed

Lines changed: 28 additions & 103 deletions

File tree

.github/workflows/BuildImage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ on:
1212
env:
1313
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
1414
ENDPOINT: "linuxserver/mods" #don't modify
15-
BASEIMAGE: "replace_baseimage" #replace
16-
MODNAME: "replace_modname" #replace
15+
BASEIMAGE: "netbox" #replace
16+
MODNAME: "dns" #replace
1717
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
18-
MULTI_ARCH: "true" #set to false if not needed
18+
MULTI_ARCH: "false" #set to false if not needed
1919

2020
jobs:
2121
set-vars:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM scratch
44

5-
LABEL maintainer="username"
5+
LABEL maintainer="hatchmt"
66

77
# copy local files
88
COPY root/ /

Dockerfile.complex

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
# Rsync - Docker mod for openssh-server
1+
# NetBox DNS - Docker mod for installing the netbox-plugin-dns plugin for NetBox
22

3-
This mod adds rsync to openssh-server, to be installed/updated during container start.
3+
This mod adds the [NetBox DNS](https://github.com/sys4/netbox-plugin-dns) plugin (PyPI: `netbox-plugin-dns`) to a netbox container.
44

5-
In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync`
5+
In netbox docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:netbox-dns`
66

7-
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2`
7+
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:netbox-dns|linuxserver/mods:netbox-mod2`
88

9-
# Mod creation instructions
9+
Update your `configuration.py` to include the plugin
1010

11-
* Fork the repo, create a new branch based on the branch `template`.
12-
* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done.
13-
* Inspect the `root` folder contents. Edit, add and remove as necessary.
14-
* 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.
15-
* Edit this readme with pertinent info, delete these instructions.
16-
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed.
17-
* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch.
18-
* Submit PR against the branch created by the team.
11+
```
12+
...
13+
# Enable installed plugins. Add the name of each plugin to the list.
14+
PLUGINS = ['netbox_dns']
1915
16+
...
17+
```
2018

21-
## Tips and tricks
19+
On the next container start, the mod adds `netbox-plugin-dns` to the pip install list before NetBox runs its database migrations, and the plugin's tables will be created automatically.
2220

23-
* Some images have helpers built in, these images are currently:
24-
* [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files)
25-
* [Code-server](https://github.com/linuxserver/docker-code-server/pull/95)
21+
## Removal
22+
23+
Before removing `DOCKER_MODS`, remove `'netbox_dns'` from the `PLUGINS` list in your `configuration.py`. Otherwise NetBox will fail to start because the plugin package will no longer be installed but is still referenced in the configuration.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run

Lines changed: 0 additions & 30 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/up

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run

Lines changed: 0 additions & 8 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/type

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/up

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/dependencies.d/init-mods renamed to root/etc/s6-overlay/s6-rc.d/init-mod-netbox-dns-add-package/dependencies.d/init-mods

File renamed without changes.

0 commit comments

Comments
 (0)