Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d062133a27 | ||
|
|
d4d83345ee | ||
|
|
2a2de68337 | ||
|
|
2016f9671f | ||
|
|
578132e39b | ||
|
|
16566a986b | ||
|
|
57eb9f32a8 | ||
|
|
6279ff8a3e | ||
|
|
8e12d4bd93 | ||
|
|
dd3f45d9e1 | ||
|
|
1ec95a01fe | ||
|
|
07865a5822 | ||
|
|
01c67f15b5 | ||
|
|
e7836fd06e | ||
|
|
ae5c66a0a7 | ||
|
|
525d571a6f | ||
|
|
5f2627bc23 | ||
|
|
a7aa89da46 | ||
|
|
4e4cc73219 | ||
|
|
2ebb22bcb4 | ||
|
|
8e03b00dd1 | ||
|
|
309212d544 | ||
|
|
ccefe55008 | ||
|
|
23f824b416 | ||
|
|
3d52be2e24 | ||
|
|
4a8b873241 |
70
.github/workflows/cve.yml
vendored
Normal file
70
.github/workflows/cve.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
name: cve
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 15 */2 * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cve:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: init / checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
with:
|
||||||
|
ref: ${{ github.ref_name }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: init / setup environment
|
||||||
|
uses: actions/github-script@62c3794a3eb6788d9a2a72b219504732c0c9a298
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { existsSync, readFileSync } = require('node:fs');
|
||||||
|
const { resolve } = require('node:path');
|
||||||
|
const { inspect } = require('node:util');
|
||||||
|
const { Buffer } = require('node:buffer');
|
||||||
|
const inputs = `${{ toJSON(github.event.inputs) }}`;
|
||||||
|
const opt = {input:{}, dot:{}};
|
||||||
|
|
||||||
|
try{
|
||||||
|
if(inputs.length > 0){
|
||||||
|
opt.input = JSON.parse(inputs);
|
||||||
|
if(opt.input?.etc){
|
||||||
|
opt.input.etc = JSON.parse(Buffer.from(opt.input.etc, 'base64').toString('ascii'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
core.warning('could not parse github.event.inputs');
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
const path = resolve('.json');
|
||||||
|
if(existsSync(path)){
|
||||||
|
try{
|
||||||
|
opt.dot = JSON.parse(readFileSync(path).toString());
|
||||||
|
}catch(e){
|
||||||
|
throw new Error('could not parse .json');
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
throw new Error('.json does not exist');
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
core.setFailed(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
core.info(inspect(opt, {showHidden:false, depth:null, colors:true}));
|
||||||
|
|
||||||
|
core.exportVariable('WORKFLOW_IMAGE', `${opt.dot.image}:${(opt.dot?.semver?.version === undefined) ? 'rolling' : opt.dot.semver.version}`);
|
||||||
|
core.exportVariable('WORKFLOW_GRYPE_SEVERITY_CUTOFF', (opt.dot?.grype?.severity || 'high'));
|
||||||
|
|
||||||
|
|
||||||
|
- name: grype / scan
|
||||||
|
id: grype
|
||||||
|
uses: anchore/scan-action@dc6246fcaf83ae86fcc6010b9824c30d7320729e
|
||||||
|
with:
|
||||||
|
image: ${{ env.WORKFLOW_IMAGE }}
|
||||||
|
fail-build: true
|
||||||
|
severity-cutoff: ${{ env.WORKFLOW_GRYPE_SEVERITY_CUTOFF }}
|
||||||
|
output-format: 'sarif'
|
||||||
|
by-cve: true
|
||||||
|
cache-db: true
|
||||||
12
.github/workflows/docker.yml
vendored
12
.github/workflows/docker.yml
vendored
@@ -16,6 +16,7 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: 'ubuntu-22.04'
|
default: 'ubuntu-22.04'
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
description: 'set WORKFLOW_BUILD'
|
description: 'set WORKFLOW_BUILD'
|
||||||
required: false
|
required: false
|
||||||
@@ -100,7 +101,7 @@ jobs:
|
|||||||
const docker = {
|
const docker = {
|
||||||
image:{
|
image:{
|
||||||
name:opt.dot.image,
|
name:opt.dot.image,
|
||||||
arch:(opt.dot.arch || 'linux/amd64,linux/arm64'),
|
arch:(opt.input?.etc?.arch || opt.dot?.arch || 'linux/amd64,linux/arm64'),
|
||||||
prefix:((opt.input?.etc?.semverprefix) ? `${opt.input?.etc?.semverprefix}-` : ''),
|
prefix:((opt.input?.etc?.semverprefix) ? `${opt.input?.etc?.semverprefix}-` : ''),
|
||||||
suffix:((opt.input?.etc?.semversuffix) ? `-${opt.input?.etc?.semversuffix}` : ''),
|
suffix:((opt.input?.etc?.semversuffix) ? `-${opt.input?.etc?.semversuffix}` : ''),
|
||||||
description:(opt.dot?.readme?.description || ''),
|
description:(opt.dot?.readme?.description || ''),
|
||||||
@@ -227,7 +228,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
|
|
||||||
- name: docker / build & push & tag grype
|
- name: docker / build image locally
|
||||||
if: env.WORKFLOW_BUILD == 'true'
|
if: env.WORKFLOW_BUILD == 'true'
|
||||||
id: docker-build
|
id: docker-build
|
||||||
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
|
||||||
@@ -256,7 +257,7 @@ jobs:
|
|||||||
cache-db: true
|
cache-db: true
|
||||||
|
|
||||||
- name: grype / fail
|
- name: grype / fail
|
||||||
if: env.WORKFLOW_BUILD == 'true' && (failure() || steps.grype.outcome == 'failure')
|
if: env.WORKFLOW_BUILD == 'true' && (failure() || steps.grype.outcome == 'failure') && steps.docker-build.outcome == 'success'
|
||||||
uses: anchore/scan-action@dc6246fcaf83ae86fcc6010b9824c30d7320729e
|
uses: anchore/scan-action@dc6246fcaf83ae86fcc6010b9824c30d7320729e
|
||||||
with:
|
with:
|
||||||
image: ${{ env.DOCKER_CACHE_GRYPE }}
|
image: ${{ env.DOCKER_CACHE_GRYPE }}
|
||||||
@@ -266,7 +267,7 @@ jobs:
|
|||||||
by-cve: true
|
by-cve: true
|
||||||
cache-db: true
|
cache-db: true
|
||||||
|
|
||||||
- name: docker / build & push
|
- name: docker / build image from cache and push to registries
|
||||||
if: env.WORKFLOW_BUILD == 'true'
|
if: env.WORKFLOW_BUILD == 'true'
|
||||||
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
|
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
|
||||||
with:
|
with:
|
||||||
@@ -412,6 +413,9 @@ jobs:
|
|||||||
if [ -f compose.yaml ]; then
|
if [ -f compose.yaml ]; then
|
||||||
git add compose.yaml
|
git add compose.yaml
|
||||||
fi
|
fi
|
||||||
|
if [ -f compose.yml ]; then
|
||||||
|
git add compose.yml
|
||||||
|
fi
|
||||||
if [ -f LICENSE ]; then
|
if [ -f LICENSE ]; then
|
||||||
git add LICENSE
|
git add LICENSE
|
||||||
fi
|
fi
|
||||||
|
|||||||
5
.json
5
.json
@@ -3,10 +3,11 @@
|
|||||||
"name": "netbird",
|
"name": "netbird",
|
||||||
"root": "/netbird",
|
"root": "/netbird",
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "0.48.0"
|
"version": "0.50.3"
|
||||||
},
|
},
|
||||||
"readme": {
|
"readme": {
|
||||||
"description": "Run netbird rootless and distroless from a single image",
|
"description": "Run netbird rootless and distroless from a single image.",
|
||||||
|
"introduction": "NetBird combines a WireGuard-based overlay network with Zero Trust Network Access, providing a unified open source platform for reliable and secure connectivity. Create your own selfhosted ZTNA mesh network.",
|
||||||
"built": {
|
"built": {
|
||||||
"netbirdio/netbird": "https://github.com/netbirdio/netbird"
|
"netbirdio/netbird": "https://github.com/netbirdio/netbird"
|
||||||
},
|
},
|
||||||
|
|||||||
59
README.md
59
README.md
@@ -1,9 +1,13 @@
|
|||||||

|

|
||||||
|
|
||||||
# NETBIRD
|
# NETBIRD
|
||||||
[<img src="https://img.shields.io/github/issues/11notes/docker-NETBIRD?color=7842f5">](https://github.com/11notes/docker-NETBIRD/issues)
|
[<img src="https://img.shields.io/github/issues/11notes/docker-NETBIRD?color=7842f5">](https://github.com/11notes/docker-NETBIRD/issues)
|
||||||
|
|
||||||
Run netbird rootless and distroless from a single image
|
Run netbird rootless and distroless from a single image.
|
||||||
|
|
||||||
|
# INTRODUCTION 📢
|
||||||
|
|
||||||
|
NetBird combines a WireGuard-based overlay network with Zero Trust Network Access, providing a unified open source platform for reliable and secure connectivity. Create your own selfhosted ZTNA mesh network.
|
||||||
|
|
||||||
# SYNOPSIS 📖
|
# SYNOPSIS 📖
|
||||||
**What can I do with this?** This image will run netbird from a single image (not multiple) [rootless](https://github.com/11notes/RTFM/blob/main/linux/container/image/rootless.md) and [distroless](https://github.com/11notes/RTFM/blob/main/linux/container/image/distroless.md) for more security. Due to the nature of a single image and not multiple, you see in the [compose.yaml](https://github.com/11notes/docker-netbird/blob/master/compose.yaml) example that an ```entrypoint:``` has been defined for each service. This image also needs some environment variables present in your **.env** file. This image's defaults (management.json) as well as the example **.env** are to be used with Keycloak as your IdP and Traefik as your reverse proxy. You can however provide your own **management.json** file and use any IdP you like and use a different reverse proxy.
|
**What can I do with this?** This image will run netbird from a single image (not multiple) [rootless](https://github.com/11notes/RTFM/blob/main/linux/container/image/rootless.md) and [distroless](https://github.com/11notes/RTFM/blob/main/linux/container/image/distroless.md) for more security. Due to the nature of a single image and not multiple, you see in the [compose.yaml](https://github.com/11notes/docker-netbird/blob/master/compose.yaml) example that an ```entrypoint:``` has been defined for each service. This image also needs some environment variables present in your **.env** file. This image's defaults (management.json) as well as the example **.env** are to be used with Keycloak as your IdP and Traefik as your reverse proxy. You can however provide your own **management.json** file and use any IdP you like and use a different reverse proxy.
|
||||||
@@ -69,6 +73,7 @@ services:
|
|||||||
- "db.etc:/postgres/etc"
|
- "db.etc:/postgres/etc"
|
||||||
- "db.var:/postgres/var"
|
- "db.var:/postgres/var"
|
||||||
- "db.backup:/postgres/backup"
|
- "db.backup:/postgres/backup"
|
||||||
|
# used for optional cron container to create automatic backups
|
||||||
- "db.cmd:/run/cmd"
|
- "db.cmd:/run/cmd"
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- "/run/postgresql:uid=1000,gid=1000"
|
- "/run/postgresql:uid=1000,gid=1000"
|
||||||
@@ -77,22 +82,8 @@ services:
|
|||||||
backend:
|
backend:
|
||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
cron:
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: "service_healthy"
|
|
||||||
restart: true
|
|
||||||
image: "11notes/cron:4.6"
|
|
||||||
environment:
|
|
||||||
TZ: "Europe/Zurich"
|
|
||||||
CRONTAB: |-
|
|
||||||
0 3 * * * cmd-socket '{"bin":"backup"}' > /proc/1/fd/1
|
|
||||||
volumes:
|
|
||||||
- "db.cmd:/run/cmd"
|
|
||||||
restart: "always"
|
|
||||||
|
|
||||||
dashboard:
|
dashboard:
|
||||||
image: "11notes/netbird:0.46.0"
|
image: "11notes/netbird:0.48.0"
|
||||||
read_only: true
|
read_only: true
|
||||||
environment:
|
environment:
|
||||||
NETBIRD_MGMT_API_ENDPOINT: "https://${NETBIRD_FQDN}"
|
NETBIRD_MGMT_API_ENDPOINT: "https://${NETBIRD_FQDN}"
|
||||||
@@ -126,7 +117,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
condition: "service_healthy"
|
condition: "service_healthy"
|
||||||
restart: true
|
restart: true
|
||||||
image: "11notes/netbird:0.46.0"
|
image: "11notes/netbird:0.48.0"
|
||||||
read_only: true
|
read_only: true
|
||||||
env_file: '.env'
|
env_file: '.env'
|
||||||
environment:
|
environment:
|
||||||
@@ -154,7 +145,7 @@ services:
|
|||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
signal:
|
signal:
|
||||||
image: "11notes/netbird:0.46.0"
|
image: "11notes/netbird:0.48.0"
|
||||||
environment:
|
environment:
|
||||||
TZ: "Europe/Zurich"
|
TZ: "Europe/Zurich"
|
||||||
entrypoint: ["/usr/local/bin/signal"]
|
entrypoint: ["/usr/local/bin/signal"]
|
||||||
@@ -172,7 +163,7 @@ services:
|
|||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
relay:
|
relay:
|
||||||
image: "11notes/netbird:0.46.0"
|
image: "11notes/netbird:0.48.0"
|
||||||
environment:
|
environment:
|
||||||
TZ: "Europe/Zurich"
|
TZ: "Europe/Zurich"
|
||||||
NB_LISTEN_ADDRESS: ":33080"
|
NB_LISTEN_ADDRESS: ":33080"
|
||||||
@@ -185,6 +176,22 @@ services:
|
|||||||
- "33080:33080/tcp"
|
- "33080:33080/tcp"
|
||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
|
# optional images
|
||||||
|
cron:
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: "service_healthy"
|
||||||
|
restart: true
|
||||||
|
image: "11notes/cron:4.6"
|
||||||
|
environment:
|
||||||
|
TZ: "Europe/Zurich"
|
||||||
|
# create daily full backup at 3 o'clock
|
||||||
|
CRONTAB: |-
|
||||||
|
0 3 * * * cmd-socket '{"bin":"backup"}' > /proc/1/fd/1
|
||||||
|
volumes:
|
||||||
|
- "db.cmd:/run/cmd"
|
||||||
|
restart: "always"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
management.etc:
|
management.etc:
|
||||||
management.var:
|
management.var:
|
||||||
@@ -218,18 +225,18 @@ networks:
|
|||||||
# MAIN TAGS 🏷️
|
# MAIN TAGS 🏷️
|
||||||
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
|
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
|
||||||
|
|
||||||
* [0.47.2](https://hub.docker.com/r/11notes/netbird/tags?name=0.47.2)
|
* [0.48.0](https://hub.docker.com/r/11notes/netbird/tags?name=0.48.0)
|
||||||
|
|
||||||
### There is no latest tag, what am I supposed to do about updates?
|
### There is no latest tag, what am I supposed to do about updates?
|
||||||
It is of my opinion that the ```:latest``` tag is super dangerous. Many times, I’ve introduced **breaking** changes to my images. This would have messed up everything for some people. If you don’t want to change the tag to the latest [semver](https://semver.org/), simply use the short versions of [semver](https://semver.org/). Instead of using ```:0.47.2``` you can use ```:0``` or ```:0.47```. Since on each new version these tags are updated to the latest version of the software, using them is identical to using ```:latest``` but at least fixed to a major or minor version.
|
It is of my opinion that the ```:latest``` tag is dangerous. Many times, I’ve introduced **breaking** changes to my images. This would have messed up everything for some people. If you don’t want to change the tag to the latest [semver](https://semver.org/), simply use the short versions of [semver](https://semver.org/). Instead of using ```:0.48.0``` you can use ```:0``` or ```:0.48```. Since on each new version these tags are updated to the latest version of the software, using them is identical to using ```:latest``` but at least fixed to a major or minor version.
|
||||||
|
|
||||||
If you still insist on having the bleeding edge release of this app, simply use the ```:rolling``` tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk!
|
If you still insist on having the bleeding edge release of this app, simply use the ```:rolling``` tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk!
|
||||||
|
|
||||||
# REGISTRIES ☁️
|
# REGISTRIES ☁️
|
||||||
```
|
```
|
||||||
docker pull 11notes/netbird:0.47.2
|
docker pull 11notes/netbird:0.48.0
|
||||||
docker pull ghcr.io/11notes/netbird:0.47.2
|
docker pull ghcr.io/11notes/netbird:0.48.0
|
||||||
docker pull quay.io/11notes/netbird:0.47.2
|
docker pull quay.io/11notes/netbird:0.48.0
|
||||||
```
|
```
|
||||||
|
|
||||||
# SOURCE 💾
|
# SOURCE 💾
|
||||||
@@ -257,4 +264,4 @@ docker pull quay.io/11notes/netbird:0.47.2
|
|||||||
# ElevenNotes™️
|
# ElevenNotes™️
|
||||||
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-netbird/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-netbird/issues), thanks. If you have a question or inputs please create a new [discussion](https://github.com/11notes/docker-netbird/discussions) instead of an issue. You can find all my other repositories on [github](https://github.com/11notes?tab=repositories).
|
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-netbird/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-netbird/issues), thanks. If you have a question or inputs please create a new [discussion](https://github.com/11notes/docker-netbird/discussions) instead of an issue. You can find all my other repositories on [github](https://github.com/11notes?tab=repositories).
|
||||||
|
|
||||||
*created 19.06.2025, 07:33:43 (CET)*
|
*created 23.06.2025, 15:37:06 (CET)*
|
||||||
@@ -4,7 +4,9 @@
|
|||||||
# GLOBAL
|
# GLOBAL
|
||||||
ARG APP_UID=1000 \
|
ARG APP_UID=1000 \
|
||||||
APP_GID=1000 \
|
APP_GID=1000 \
|
||||||
BUILD_ROOT="/go/netbird/management /go/netbird/relay /go/netbird/signal"
|
BUILD_SRC=https://github.com/netbirdio/netbird.git \
|
||||||
|
BUILD_ROOT="/go/netbird/management /go/netbird/relay /go/netbird/signal" \
|
||||||
|
GO_VERSION=1.24
|
||||||
|
|
||||||
# :: FOREIGN IMAGES
|
# :: FOREIGN IMAGES
|
||||||
FROM 11notes/nginx:stable AS distroless-nginx
|
FROM 11notes/nginx:stable AS distroless-nginx
|
||||||
@@ -15,77 +17,51 @@
|
|||||||
# ║ BUILD ║
|
# ║ BUILD ║
|
||||||
# ╚═════════════════════════════════════════════════════╝
|
# ╚═════════════════════════════════════════════════════╝
|
||||||
# :: netbird
|
# :: netbird
|
||||||
FROM golang:1.24-alpine AS build
|
FROM 11notes/go:${GO_VERSION} AS build
|
||||||
COPY --from=util /usr/local/bin /usr/local/bin
|
|
||||||
ARG APP_VERSION \
|
ARG APP_VERSION \
|
||||||
BUILD_ROOT \
|
BUILD_SRC \
|
||||||
BUILD_BIN
|
BUILD_ROOT
|
||||||
|
|
||||||
ENV CGO_ENABLED=0
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk --update --no-cache add \
|
git clone ${BUILD_SRC} -b v${APP_VERSION}; \
|
||||||
build-base \
|
sed -i 's/"development"/"v'${APP_VERSION}'"/' /go/netbird/version/version.go;
|
||||||
upx \
|
|
||||||
git;
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
git clone https://github.com/netbirdio/netbird -b v${APP_VERSION};
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
mkdir -p /distroless/usr/local/bin; \
|
|
||||||
for BUILD in ${BUILD_ROOT}; do \
|
for BUILD in ${BUILD_ROOT}; do \
|
||||||
cd ${BUILD}; \
|
cd ${BUILD}; \
|
||||||
BIN="${BUILD}/$(echo ${BUILD} | awk -F '/' '{print $4}')"; \
|
BUILD_BIN="${BUILD}/$(echo ${BUILD} | awk -F '/' '{print $4}')"; \
|
||||||
go build -ldflags="-extldflags=-static" -o ${BIN} main.go; \
|
go mod tidy; \
|
||||||
eleven checkStatic ${BIN}; \
|
eleven go build ${BUILD_BIN} main.go; \
|
||||||
eleven strip ${BIN}; \
|
eleven distroless ${BUILD_BIN}; \
|
||||||
cp ${BIN} /distroless/usr/local/bin; \
|
|
||||||
done; \
|
done; \
|
||||||
mv /distroless/usr/local/bin/management /distroless/usr/local/bin/netbird;
|
mv /distroless/usr/local/bin/management /distroless/usr/local/bin/netbird;
|
||||||
|
|
||||||
# :: management
|
# :: management
|
||||||
FROM golang:1.24-alpine AS management
|
FROM 11notes/go:${GO_VERSION} AS management
|
||||||
COPY --from=util /usr/local/bin /usr/local/bin
|
|
||||||
COPY ./build/go/management /go/management
|
COPY ./build/go/management /go/management
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
ARG BIN=/go/management/management
|
ARG BUILD_BIN=/go/management/management
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
apk --update --no-cache add \
|
|
||||||
build-base \
|
|
||||||
upx;
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
cd /go/management; \
|
cd /go/management; \
|
||||||
go build -ldflags="-extldflags=-static" -o ${BIN} main.go; \
|
eleven go build ${BUILD_BIN} main.go; \
|
||||||
mkdir -p /distroless/usr/local/bin; \
|
eleven distroless ${BUILD_BIN};
|
||||||
eleven checkStatic ${BIN}; \
|
|
||||||
eleven strip ${BIN}; \
|
|
||||||
cp ${BIN} /distroless/usr/local/bin;
|
|
||||||
|
|
||||||
# :: dashboard
|
# :: dashboard
|
||||||
FROM golang:1.24-alpine AS dashboard
|
FROM 11notes/go:${GO_VERSION} AS dashboard
|
||||||
COPY --from=util /usr/local/bin /usr/local/bin
|
|
||||||
COPY ./build/go/dashboard /go/dashboard
|
COPY ./build/go/dashboard /go/dashboard
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
ARG BIN=/go/dashboard/dashboard
|
ARG BUILD_BIN=/go/dashboard/dashboard
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk --update --no-cache add \
|
apk --update --no-cache add \
|
||||||
build-base \
|
|
||||||
upx \
|
|
||||||
git \
|
|
||||||
nodejs \
|
nodejs \
|
||||||
npm;
|
npm;
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
cd /go/dashboard; \
|
cd /go/dashboard; \
|
||||||
go build -ldflags="-extldflags=-static" -o ${BIN} main.go; \
|
eleven go build ${BUILD_BIN} main.go; \
|
||||||
mkdir -p /distroless/usr/local/bin; \
|
eleven distroless ${BUILD_BIN};
|
||||||
eleven checkStatic ${BIN}; \
|
|
||||||
eleven strip ${BIN}; \
|
|
||||||
cp ${BIN} /distroless/usr/local/bin;
|
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
git clone https://github.com/netbirdio/dashboard /dashboard;
|
git clone https://github.com/netbirdio/dashboard /dashboard;
|
||||||
@@ -100,7 +76,7 @@
|
|||||||
|
|
||||||
# :: file system
|
# :: file system
|
||||||
FROM alpine AS file-system
|
FROM alpine AS file-system
|
||||||
COPY --from=util /usr/local/bin /usr/local/bin
|
COPY --from=util / /
|
||||||
ARG APP_ROOT
|
ARG APP_ROOT
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
|||||||
36
compose.yaml
36
compose.yaml
@@ -1,4 +1,9 @@
|
|||||||
name: "netbird"
|
name: "netbird"
|
||||||
|
|
||||||
|
x-image-netbird: &image
|
||||||
|
image: "11notes/netbird:0.50.2"
|
||||||
|
read_only: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: "11notes/postgres:16"
|
image: "11notes/postgres:16"
|
||||||
@@ -6,35 +11,22 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
TZ: "Europe/Zurich"
|
TZ: "Europe/Zurich"
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
# make a full and compressed database backup each day at 03:00
|
||||||
|
POSTGRES_BACKUP_SCHEDULE: "0 3 * * *"
|
||||||
volumes:
|
volumes:
|
||||||
- "db.etc:/postgres/etc"
|
- "db.etc:/postgres/etc"
|
||||||
- "db.var:/postgres/var"
|
- "db.var:/postgres/var"
|
||||||
- "db.backup:/postgres/backup"
|
- "db.backup:/postgres/backup"
|
||||||
- "db.cmd:/run/cmd"
|
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- "/run/postgresql:uid=1000,gid=1000"
|
# needed for read-only
|
||||||
|
- "/postgres/run:uid=1000,gid=1000"
|
||||||
- "/postgres/log:uid=1000,gid=1000"
|
- "/postgres/log:uid=1000,gid=1000"
|
||||||
networks:
|
networks:
|
||||||
backend:
|
backend:
|
||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
cron:
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: "service_healthy"
|
|
||||||
restart: true
|
|
||||||
image: "11notes/cron:4.6"
|
|
||||||
environment:
|
|
||||||
TZ: "Europe/Zurich"
|
|
||||||
CRONTAB: |-
|
|
||||||
0 3 * * * cmd-socket '{"bin":"backup"}' > /proc/1/fd/1
|
|
||||||
volumes:
|
|
||||||
- "db.cmd:/run/cmd"
|
|
||||||
restart: "always"
|
|
||||||
|
|
||||||
dashboard:
|
dashboard:
|
||||||
image: "11notes/netbird:0.46.0"
|
<<: *image
|
||||||
read_only: true
|
|
||||||
environment:
|
environment:
|
||||||
NETBIRD_MGMT_API_ENDPOINT: "https://${NETBIRD_FQDN}"
|
NETBIRD_MGMT_API_ENDPOINT: "https://${NETBIRD_FQDN}"
|
||||||
NETBIRD_MGMT_GRPC_API_ENDPOINT: "https://${NETBIRD_FQDN}"
|
NETBIRD_MGMT_GRPC_API_ENDPOINT: "https://${NETBIRD_FQDN}"
|
||||||
@@ -67,8 +59,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
condition: "service_healthy"
|
condition: "service_healthy"
|
||||||
restart: true
|
restart: true
|
||||||
image: "11notes/netbird:0.46.0"
|
<<: *image
|
||||||
read_only: true
|
|
||||||
env_file: '.env'
|
env_file: '.env'
|
||||||
environment:
|
environment:
|
||||||
TZ: "Europe/Zurich"
|
TZ: "Europe/Zurich"
|
||||||
@@ -95,7 +86,7 @@ services:
|
|||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
signal:
|
signal:
|
||||||
image: "11notes/netbird:0.46.0"
|
<<: *image
|
||||||
environment:
|
environment:
|
||||||
TZ: "Europe/Zurich"
|
TZ: "Europe/Zurich"
|
||||||
entrypoint: ["/usr/local/bin/signal"]
|
entrypoint: ["/usr/local/bin/signal"]
|
||||||
@@ -113,7 +104,7 @@ services:
|
|||||||
restart: "always"
|
restart: "always"
|
||||||
|
|
||||||
relay:
|
relay:
|
||||||
image: "11notes/netbird:0.46.0"
|
<<: *image
|
||||||
environment:
|
environment:
|
||||||
TZ: "Europe/Zurich"
|
TZ: "Europe/Zurich"
|
||||||
NB_LISTEN_ADDRESS: ":33080"
|
NB_LISTEN_ADDRESS: ":33080"
|
||||||
@@ -134,7 +125,6 @@ volumes:
|
|||||||
db.etc:
|
db.etc:
|
||||||
db.var:
|
db.var:
|
||||||
db.backup:
|
db.backup:
|
||||||
db.cmd:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
frontend:
|
frontend:
|
||||||
|
|||||||
24
project.md
24
project.md
@@ -2,15 +2,19 @@ ${{ content_synopsis }} This image will run netbird from a single image (not mul
|
|||||||
|
|
||||||
The init binary **management** will replace all variables in the format ```${VARIABLE}``` with all environment variables present in the service.
|
The init binary **management** will replace all variables in the format ```${VARIABLE}``` with all environment variables present in the service.
|
||||||
|
|
||||||
${{ github:> [!IMPORTANT] }}
|
${{ content_uvp }} Good question! Because ...
|
||||||
${{ github:> }}* This image runs as 1000:1000 by default, most other images run everything as root
|
|
||||||
${{ github:> }}* This image has no shell since it is distroless, most other images run on a distro like Debian or Alpine with full shell access (security)
|
|
||||||
${{ github:> }}* This image does not ship with any critical or high rated CVE and is automatically maintained via CI/CD, most other images mostly have no CVE scanning or code quality tools in place
|
|
||||||
${{ github:> }}* This image is created via a secure, pinned CI/CD process and immune to upstream attacks, most other images have upstream dependencies that can be exploited
|
|
||||||
${{ github:> }}* This image works as read-only, most other images need to write files to the image filesystem
|
|
||||||
${{ github:> }}* This image is a lot smaller than most other images
|
|
||||||
|
|
||||||
If you value security, simplicity and the ability to interact with the maintainer and developer of an image. Using my images is a great start in that direction.
|
${{ github:> [!IMPORTANT] }}
|
||||||
|
${{ github:> }}* ... this image runs [rootless](https://github.com/11notes/RTFM/blob/main/linux/container/image/rootless.md) as 1000:1000
|
||||||
|
${{ github:> }}* ... this image has no shell since it is [distroless](https://github.com/11notes/RTFM/blob/main/linux/container/image/distroless.md)
|
||||||
|
${{ github:> }}* ... this image is auto updated to the latest version via CI/CD
|
||||||
|
${{ github:> }}* ... this image has a health check
|
||||||
|
${{ github:> }}* ... this image runs read-only
|
||||||
|
${{ github:> }}* ... this image is automatically scanned for CVEs before and after publishing
|
||||||
|
${{ github:> }}* ... this image is created via a secure and pinned CI/CD process
|
||||||
|
${{ github:> }}* ... this image is very small
|
||||||
|
|
||||||
|
If you value security, simplicity and optimizations to the extreme, then this image might be for you.
|
||||||
|
|
||||||
# COMPARISON 🏁
|
# COMPARISON 🏁
|
||||||
Below you find a comparison between this image and the most used or original one.
|
Below you find a comparison between this image and the most used or original one.
|
||||||
@@ -24,7 +28,7 @@ Below you find a comparison between this image and the most used or original one
|
|||||||
|
|
||||||
${{ title_volumes }}
|
${{ title_volumes }}
|
||||||
* **${{ json_root }}/etc** - Directory of your management.json config
|
* **${{ json_root }}/etc** - Directory of your management.json config
|
||||||
* **${{ json_root }}/var** - Directory of dynamic data from differnet init systems (relay, signal, management)
|
* **${{ json_root }}/var** - Directory of dynamic data from different init systems (relay, signal, management)
|
||||||
|
|
||||||
# EXAMPLE ENV FILE 📑
|
# EXAMPLE ENV FILE 📑
|
||||||
```ini
|
```ini
|
||||||
@@ -63,4 +67,4 @@ ${{ content_tips }}
|
|||||||
|
|
||||||
${{ title_caution }}
|
${{ title_caution }}
|
||||||
${{ github:> [!CAUTION] }}
|
${{ github:> [!CAUTION] }}
|
||||||
${{ github:> }}* Because this image is distroless, it only works with PostgreSQL, not SQLite. The GeoLocation middleware is also disabled because of this!
|
${{ github:> }}* Because this image is distroless, it only works with PostgreSQL, **not SQLite**. The GeoLocation middleware is also disabled because of this!
|
||||||
Reference in New Issue
Block a user