Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

Commit 9b26d53

Browse files
authored
Merge pull request #5 from thelamer/master
Full Local webapp stack
2 parents 3ce31be + 3a7c5d8 commit 9b26d53

File tree

14 files changed

+298
-70
lines changed

14 files changed

+298
-70
lines changed

Dockerfile

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,42 @@ FROM lsiobase/alpine:3.10
33
# set version label
44
ARG BUILD_DATE
55
ARG VERSION
6+
ARG WEBAPP_VERSION
67
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
78
LABEL maintainer="thelamer"
89

9-
# build args
10-
ARG DOWNURL="https://boot.netboot.xyz/ipxe"
11-
1210
RUN \
11+
echo "**** install build packages ****" && \
12+
apk add --no-cache --virtual=build-dependencies \
13+
nodejs-npm && \
1314
echo "**** install runtime packages ****" && \
1415
apk add --no-cache \
16+
curl \
17+
jq \
18+
nginx \
19+
nodejs \
1520
tftp-hpa && \
16-
echo "**** download netboot payloads ****" && \
17-
wget -O \
18-
/config/netboot.xyz.kpxe \
19-
${DOWNURL}/netboot.xyz.kpxe && \
20-
wget -O \
21-
/config/netboot.xyz.efi \
22-
${DOWNURL}/netboot.xyz.efi && \
23-
echo "**** Permissions ****" && \
24-
chown -R abc:abc \
25-
/config
21+
echo "**** install WebApp ****" && \
22+
if [ -z ${WEBAPP_VERSION+x} ]; then \
23+
WEBAPP_VERSION=$(curl -sX GET "https://api.github.com/repos/netbootxyz/webapp/releases/latest" \
24+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
25+
fi && \
26+
curl -o \
27+
/tmp/webapp.tar.gz -L \
28+
"https://github.com/netbootxyz/webapp/archive/${WEBAPP_VERSION}.tar.gz" && \
29+
tar xf \
30+
/tmp/webapp.tar.gz -C \
31+
/app/ --strip-components=1 && \
32+
npm config set unsafe-perm true && \
33+
npm install --prefix /app && \
34+
echo "**** cleanup ****" && \
35+
apk del --purge \
36+
build-dependencies && \
37+
rm -rf \
38+
/tmp/*
39+
40+
# copy local files
41+
COPY root/ /
2642

27-
# add local files
28-
COPY /root /
43+
# app runs on port 3000
44+
EXPOSE 3000

Dockerfile.aarch64

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,42 @@ FROM lsiobase/alpine:arm64v8-3.10
33
# set version label
44
ARG BUILD_DATE
55
ARG VERSION
6+
ARG WEBAPP_VERSION
67
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
78
LABEL maintainer="thelamer"
89

9-
# build args
10-
ARG DOWNURL="https://boot.netboot.xyz/ipxe"
11-
1210
RUN \
11+
echo "**** install build packages ****" && \
12+
apk add --no-cache --virtual=build-dependencies \
13+
nodejs-npm && \
1314
echo "**** install runtime packages ****" && \
1415
apk add --no-cache \
16+
curl \
17+
jq \
18+
nginx \
19+
nodejs \
1520
tftp-hpa && \
16-
echo "**** download netboot payloads ****" && \
17-
wget -O \
18-
/config/netboot.xyz.kpxe \
19-
${DOWNURL}/netboot.xyz.kpxe && \
20-
wget -O \
21-
/config/netboot.xyz.efi \
22-
${DOWNURL}/netboot.xyz.efi && \
23-
echo "**** Permissions ****" && \
24-
chown -R abc:abc \
25-
/config
21+
echo "**** install WebApp ****" && \
22+
if [ -z ${WEBAPP_VERSION+x} ]; then \
23+
WEBAPP_VERSION=$(curl -sX GET "https://api.github.com/repos/netbootxyz/webapp/releases/latest" \
24+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
25+
fi && \
26+
curl -o \
27+
/tmp/webapp.tar.gz -L \
28+
"https://github.com/netbootxyz/webapp/archive/${WEBAPP_VERSION}.tar.gz" && \
29+
tar xf \
30+
/tmp/webapp.tar.gz -C \
31+
/app/ --strip-components=1 && \
32+
npm config set unsafe-perm true && \
33+
npm install --prefix /app && \
34+
echo "**** cleanup ****" && \
35+
apk del --purge \
36+
build-dependencies && \
37+
rm -rf \
38+
/tmp/*
39+
40+
# copy local files
41+
COPY root/ /
2642

27-
# add local files
28-
COPY /root /
43+
# app runs on port 3000
44+
EXPOSE 3000

Dockerfile.armhf

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,42 @@ FROM lsiobase/alpine:arm32v7-3.10
33
# set version label
44
ARG BUILD_DATE
55
ARG VERSION
6+
ARG WEBAPP_VERSION
67
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
78
LABEL maintainer="thelamer"
89

9-
# build args
10-
ARG DOWNURL="https://boot.netboot.xyz/ipxe"
11-
1210
RUN \
11+
echo "**** install build packages ****" && \
12+
apk add --no-cache --virtual=build-dependencies \
13+
nodejs-npm && \
1314
echo "**** install runtime packages ****" && \
1415
apk add --no-cache \
16+
curl \
17+
jq \
18+
nginx \
19+
nodejs \
1520
tftp-hpa && \
16-
echo "**** download netboot payloads ****" && \
17-
wget -O \
18-
/config/netboot.xyz.kpxe \
19-
${DOWNURL}/netboot.xyz.kpxe && \
20-
wget -O \
21-
/config/netboot.xyz.efi \
22-
${DOWNURL}/netboot.xyz.efi && \
23-
echo "**** Permissions ****" && \
24-
chown -R abc:abc \
25-
/config
21+
echo "**** install WebApp ****" && \
22+
if [ -z ${WEBAPP_VERSION+x} ]; then \
23+
WEBAPP_VERSION=$(curl -sX GET "https://api.github.com/repos/netbootxyz/webapp/releases/latest" \
24+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
25+
fi && \
26+
curl -o \
27+
/tmp/webapp.tar.gz -L \
28+
"https://github.com/netbootxyz/webapp/archive/${WEBAPP_VERSION}.tar.gz" && \
29+
tar xf \
30+
/tmp/webapp.tar.gz -C \
31+
/app/ --strip-components=1 && \
32+
npm config set unsafe-perm true && \
33+
npm install --prefix /app && \
34+
echo "**** cleanup ****" && \
35+
apk del --purge \
36+
build-dependencies && \
37+
rm -rf \
38+
/tmp/*
39+
40+
# copy local files
41+
COPY root/ /
2642

27-
# add local files
28-
COPY /root /
43+
# app runs on port 3000
44+
EXPOSE 3000

Jenkinsfile

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ pipeline {
1616
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
1717
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
1818
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
19+
EXT_GIT_BRANCH = 'master'
20+
EXT_USER = 'netbootxyz'
21+
EXT_REPO = 'webapp'
1922
CONTAINER_NAME = 'netbootxyz'
20-
BUILD_VERSION_ARG = 'NETBOOTXYZ_SHA'
23+
BUILD_VERSION_ARG = 'WEBAPP_VERSION'
2124
LS_USER = 'linuxserver'
2225
LS_REPO = 'docker-netbootxyz'
2326
DOCKERHUB_IMAGE = 'linuxserver/netbootxyz'
@@ -26,10 +29,10 @@ pipeline {
2629
DIST_IMAGE = 'alpine'
2730
MULTIARCH='true'
2831
CI='true'
29-
CI_WEB='false'
30-
CI_PORT='69'
32+
CI_WEB='true'
33+
CI_PORT='3000'
3134
CI_SSL='false'
32-
CI_DELAY='60'
35+
CI_DELAY='120'
3336
CI_DOCKERENV='TZ=US/Pacific'
3437
CI_AUTH='user:password'
3538
CI_WEBPATH=''
@@ -98,16 +101,23 @@ pipeline {
98101
/* ########################
99102
External Release Tagging
100103
######################## */
101-
// If this is a custom command to determine version use that command
102-
stage("Set tag custom bash"){
103-
steps{
104-
script{
105-
env.EXT_RELEASE = sh(
106-
script: ''' curl -sL https://boot.netboot.xyz/ipxe/netboot.xyz-sha256-checksums.txt | grep 'netboot.xyz.kpxe' | cut -c1-8 ''',
107-
returnStdout: true).trim()
108-
env.RELEASE_LINK = 'custom_command'
109-
}
110-
}
104+
// If this is a stable github release use the latest endpoint from github to determine the ext tag
105+
stage("Set ENV github_stable"){
106+
steps{
107+
script{
108+
env.EXT_RELEASE = sh(
109+
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
110+
returnStdout: true).trim()
111+
}
112+
}
113+
}
114+
// If this is a stable or devel github release generate the link for the build message
115+
stage("Set ENV github_link"){
116+
steps{
117+
script{
118+
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
119+
}
120+
}
111121
}
112122
// Sanitize the release tag and strip illegal docker or github characters
113123
stage("Sanitize tag"){
@@ -671,11 +681,11 @@ pipeline {
671681
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
672682
echo "Pushing New release for Tag"
673683
sh '''#! /bin/bash
674-
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
684+
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
675685
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
676686
"target_commitish": "master",\
677687
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
678-
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
688+
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
679689
printf '","draft": false,"prerelease": false}' >> releasebody.json
680690
paste -d'\\0' start releasebody.json > releasebody.json.done
681691
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ The architectures supported by this image are:
5454
| arm64 | arm64v8-latest |
5555
| armhf | arm32v7-latest |
5656

57+
## Version Tags
58+
59+
This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them.
60+
61+
| Tag | Description |
62+
| :----: | --- |
63+
| latest | Web application for full self hosting |
64+
| tftp | TFTP server only with NETBOOT.XYZ boot files |
5765

5866
## Usage
5967

@@ -64,7 +72,14 @@ Here are some example snippets to help you get started creating a container.
6472
```
6573
docker create \
6674
--name=netbootxyz \
75+
-e PUID=1000 \
76+
-e PGID=1000 \
77+
-e MENU_VERSION=1.9.9 `#optional` \
78+
-p 3000:3000 \
6779
-p 69:69/udp \
80+
-p 8080:80 `#optional` \
81+
-v /path/to/config:/config \
82+
-v /path/to/assets:/assets `#optional` \
6883
--restart unless-stopped \
6984
linuxserver/netbootxyz
7085
```
@@ -81,8 +96,17 @@ services:
8196
netbootxyz:
8297
image: linuxserver/netbootxyz
8398
container_name: netbootxyz
99+
environment:
100+
- PUID=1000
101+
- PGID=1000
102+
- MENU_VERSION=1.9.9 #optional
103+
volumes:
104+
- /path/to/config:/config
105+
- /path/to/assets:/assets #optional
84106
ports:
107+
- 3000:3000
85108
- 69:69/udp
109+
- 8080:80 #optional
86110
restart: unless-stopped
87111
```
88112

@@ -92,7 +116,14 @@ Container images are configured using parameters passed at runtime (such as thos
92116

93117
| Parameter | Function |
94118
| :----: | --- |
119+
| `-p 3000` | Web configuration interface. |
95120
| `-p 69/udp` | TFTP Port. |
121+
| `-p 80` | NGINX server for hosting assets. |
122+
| `-e PUID=1000` | for UserID - see below for explanation |
123+
| `-e PGID=1000` | for GroupID - see below for explanation |
124+
| `-e MENU_VERSION=1.9.9` | Specify a specific version of boot files you want to use from NETBOOT.XYZ (unset pulls latest) |
125+
| `-v /config` | Storage for boot menu files and web application config |
126+
| `-v /assets` | Storage for NETBOOT.XYZ bootable assets (live CDs and other files) |
96127

97128
## Environment variables from files (Docker secrets)
98129

@@ -106,6 +137,19 @@ As an example:
106137

107138
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
108139

140+
## User / Group Identifiers
141+
142+
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
143+
144+
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
145+
146+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
147+
148+
```
149+
$ id username
150+
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
151+
```
152+
109153

110154
 
111155
## Application Setup
@@ -246,4 +290,6 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
246290

247291
## Versions
248292

293+
* **13.12.19:** - Swapping latest tag over to webapp stack for management.
294+
* **10.12.19:** - Adding tftp branch to provide tftp only option to latest users.
249295
* **22.10.19:** - Initial release.

jenkins-vars.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
# jenkins variables
44
project_name: docker-netbootxyz
5-
external_type: na
6-
custom_version_command: "curl -sL https://boot.netboot.xyz/ipxe/netboot.xyz-sha256-checksums.txt | grep 'netboot.xyz.kpxe' | cut -c1-8"
5+
external_type: github_stable
76
release_type: stable
87
release_tag: latest
98
ls_branch: master
109
repo_vars:
10+
- EXT_GIT_BRANCH = 'master'
11+
- EXT_USER = 'netbootxyz'
12+
- EXT_REPO = 'webapp'
1113
- CONTAINER_NAME = 'netbootxyz'
12-
- BUILD_VERSION_ARG = 'NETBOOTXYZ_SHA'
14+
- BUILD_VERSION_ARG = 'WEBAPP_VERSION'
1315
- LS_USER = 'linuxserver'
1416
- LS_REPO = 'docker-netbootxyz'
1517
- DOCKERHUB_IMAGE = 'linuxserver/netbootxyz'
@@ -18,10 +20,10 @@ repo_vars:
1820
- DIST_IMAGE = 'alpine'
1921
- MULTIARCH='true'
2022
- CI='true'
21-
- CI_WEB='false'
22-
- CI_PORT='69'
23+
- CI_WEB='true'
24+
- CI_PORT='3000'
2325
- CI_SSL='false'
24-
- CI_DELAY='60'
26+
- CI_DELAY='120'
2527
- CI_DOCKERENV='TZ=US/Pacific'
2628
- CI_AUTH='user:password'
2729
- CI_WEBPATH=''

0 commit comments

Comments
 (0)