Skip to content

Commit b510862

Browse files
authored
Merge pull request #657 from netbox-community/develop
Version 1.5.0
2 parents 9c66cc4 + 9ab54f2 commit b510862

14 files changed

+163
-89
lines changed

.github/workflows/release.yml

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: release
22

33
on:
4-
push:
5-
branches:
6-
- release
4+
release:
5+
types:
6+
- published
77
schedule:
88
- cron: '45 5 * * *'
99

@@ -20,64 +20,82 @@ jobs:
2020
runs-on: ubuntu-latest
2121
name: Builds new NetBox Docker Images
2222
steps:
23-
- id: git-checkout
23+
-
2424
name: Checkout
2525
uses: actions/checkout@v2
26-
- id: docker-build
26+
-
27+
name: Get Version of NetBox Docker
28+
run: |
29+
echo "::set-output name=version::$(cat VERSION)"
30+
shell: bash
31+
-
32+
name: Set up QEMU
33+
uses: docker/setup-qemu-action@v1
34+
-
35+
id: buildx-setup
36+
name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v1
38+
with:
39+
install: true
40+
-
41+
name: Available platforms
42+
run: echo ${{ steps.buildx-setup.outputs.platforms }}
43+
-
44+
id: docker-build
2745
name: Build the image with '${{ matrix.build_cmd }}'
2846
run: ${{ matrix.build_cmd }}
2947
env:
3048
GH_ACTION: enable
31-
- id: docker-test
49+
-
3250
name: Test the image
3351
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
3452
if: steps.docker-build.outputs.skipped != 'true'
35-
- id: registry-login
36-
name: Login to the Docker Registry
37-
run: |
38-
echo "::add-mask::$DOCKERHUB_USERNAME"
39-
echo "::add-mask::$DOCKERHUB_PASSWORD"
40-
docker login -u "$DOCKERHUB_USERNAME" --password "${DOCKERHUB_PASSWORD}" "${DOCKER_REGISTRY}"
41-
env:
42-
DOCKERHUB_USERNAME: ${{ secrets.dockerhub_username }}
43-
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
53+
54+
# docker.io
55+
-
56+
name: Login to docker.io
57+
uses: docker/login-action@v1
58+
with:
59+
registry: docker.io
60+
username: ${{ secrets.dockerhub_username }}
61+
password: ${{ secrets.dockerhub_password }}
4462
if: steps.docker-build.outputs.skipped != 'true'
45-
- id: registry-push
46-
name: Push the image
63+
-
64+
name: Push the image to docker.io
4765
run: ${{ matrix.build_cmd }} --push-only
4866
if: steps.docker-build.outputs.skipped != 'true'
49-
- id: registry-logout
50-
name: Logout of the Docker Registry
51-
run: docker logout "${DOCKER_REGISTRY}"
52-
if: steps.docker-build.outputs.skipped != 'true'
5367

54-
# Quay.io
55-
- id: quayio-docker-build
56-
name: Build the image with '${{ matrix.build_cmd }}'
57-
run: ${{ matrix.build_cmd }}
68+
# quay.io
69+
-
70+
name: Login to Quay.io
71+
uses: docker/login-action@v1
72+
with:
73+
registry: quay.io
74+
username: ${{ secrets.quayio_username }}
75+
password: ${{ secrets.quayio_password }}
76+
if: steps.docker-build.outputs.skipped != 'true'
77+
-
78+
name: Build and push the image with '${{ matrix.build_cmd }}'
79+
run: ${{ matrix.build_cmd }} --push
5880
env:
5981
DOCKER_REGISTRY: quay.io
6082
GH_ACTION: enable
61-
- id: quayio-registry-login
62-
name: Login to the Quay.io Registry
63-
run: |
64-
echo "::add-mask::$QUAYIO_USERNAME"
65-
echo "::add-mask::$QUAYIO_PASSWORD"
66-
docker login -u "$QUAYIO_USERNAME" --password "${QUAYIO_PASSWORD}" "${DOCKER_REGISTRY}"
67-
env:
68-
DOCKER_REGISTRY: quay.io
69-
QUAYIO_USERNAME: ${{ secrets.quayio_username }}
70-
QUAYIO_PASSWORD: ${{ secrets.quayio_password }}
7183
if: steps.docker-build.outputs.skipped != 'true'
72-
- id: quayio-registry-push
73-
name: Push the image
74-
run: ${{ matrix.build_cmd }} --push-only
75-
env:
76-
DOCKER_REGISTRY: quay.io
84+
85+
# ghcr.io
86+
-
87+
name: Login to GitHub Container Registry
88+
uses: docker/login-action@v1
89+
with:
90+
registry: ghcr.io
91+
username: ${{ github.repository_owner }}
92+
password: ${{ secrets.GITHUB_TOKEN }}
7793
if: steps.docker-build.outputs.skipped != 'true'
78-
- id: quayio-registry-logout
79-
name: Logout of the Docker Registry
80-
run: docker logout "${DOCKER_REGISTRY}"
94+
-
95+
name: Build and push the image with '${{ matrix.build_cmd }}'
96+
run: ${{ matrix.build_cmd }} --push
8197
env:
82-
DOCKER_REGISTRY: quay.io
98+
DOCKER_REGISTRY: ghcr.io
99+
DOCKER_ORG: netbox-community
100+
GH_ACTION: enable
83101
if: steps.docker-build.outputs.skipped != 'true'

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN apk add --no-cache \
6363
libjpeg-turbo \
6464
libxslt \
6565
openssl \
66+
postgresql-client \
6667
postgresql-libs \
6768
py3-pip \
6869
python3 \

README.md

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,28 @@
77
![Docker Pulls](https://img.shields.io/docker/pulls/netboxcommunity/netbox)
88
[![GitHub license](https://img.shields.io/github/license/netbox-community/netbox-docker)][netbox-docker-license]
99

10-
[The Github repository](netbox-docker-github) houses the components needed to build NetBox as a Docker container.
11-
Images are built using this code and are released to [Docker Hub][netbox-dockerhub] and [Quay.io][netbox-quayio] once a day.
10+
[The Github repository](netbox-docker-github) houses the components needed to build NetBox as a container.
11+
Images are built regularly using the code in that repository and are pushed to [Docker Hub][netbox-dockerhub], [Quay.io][netbox-quayio] and [GitHub Container Registry][netbox-ghcr].
1212

1313
Do you have any questions?
1414
Before opening an issue on Github,
15-
please join the [our Slack][netbox-docker-slack] and ask for help in the [`#netbox-docker`][netbox-docker-slack-channel] channel.
15+
please join [our Slack][netbox-docker-slack] and ask for help in the [`#netbox-docker`][netbox-docker-slack-channel] channel.
1616

1717
[github-stargazers]: https://github.com/netbox-community/netbox-docker/stargazers
1818
[github-release]: https://github.com/netbox-community/netbox-docker/releases
1919
[netbox-docker-microbadger]: https://microbadger.com/images/netboxcommunity/netbox
2020
[netbox-dockerhub]: https://hub.docker.com/r/netboxcommunity/netbox/
21+
[netbox-quayio]: https://quay.io/repository/netboxcommunity/netbox
22+
[netbox-ghcr]: https://ghcr.io/netbox-community/netbox/
2123
[netbox-docker-github]: https://github.com/netbox-community/netbox-docker/
2224
[netbox-docker-slack]: https://join.slack.com/t/netdev-community/shared_invite/zt-mtts8g0n-Sm6Wutn62q_M4OdsaIycrQ
2325
[netbox-docker-slack-channel]: https://netdev-community.slack.com/archives/C01P0GEVBU7
2426
[netbox-slack-channel]: https://netdev-community.slack.com/archives/C01P0FRSXRV
2527
[netbox-docker-license]: https://github.com/netbox-community/netbox-docker/blob/release/LICENSE
26-
[netbox-quayio]: https://quay.io/repository/netboxcommunity/netbox
27-
28-
## Docker Tags
29-
30-
* `vX.Y.Z`: These are release builds, automatically built from [the corresponding releases of NetBox][netbox-releases].
31-
* `latest`: These are release builds, automatically built from [the `master` branch of NetBox][netbox-master].
32-
* `snapshot`: These are pre-release builds, automatically built from the [`develop` branch of NetBox][netbox-develop].
33-
* `develop-X.Y`: These are pre-release builds, automatically built from the corresponding [branch of NetBox][netbox-branches].
34-
35-
Then there is currently one extra tags for each of the above tags:
36-
37-
* `-ldap`: Contains additional dependencies and configurations for connecting NetBox to an LDAP directory.
38-
[Learn more about that in our wiki][netbox-docker-ldap].
39-
40-
New images are built and published automatically every ~24h.
41-
42-
[netbox-releases]: https://github.com/netbox-community/netbox/releases
43-
[netbox-master]: https://github.com/netbox-community/netbox/tree/master
44-
[netbox-develop]: https://github.com/netbox-community/netbox/tree/develop
45-
[netbox-branches]: https://github.com/netbox-community/netbox/branches
46-
[netbox-docker-ldap]: https://github.com/netbox-community/netbox-docker/wiki/LDAP
4728

4829
## Quickstart
4930

50-
To get NetBox Docker up and running run the following commands.
31+
To get _NetBox Docker_ up and running run the following commands.
5132
There is a more complete [_Getting Started_ guide on our wiki][wiki-getting-started] which explains every step.
5233

5334
```bash
@@ -77,10 +58,59 @@ The default credentials are:
7758
[wiki-getting-started]: https://github.com/netbox-community/netbox-docker/wiki/Getting-Started
7859
[docker-reception]: https://github.com/nxt-engineering/reception
7960

61+
## Container Image Tags
62+
63+
New container images are built and published automatically every ~24h.
64+
65+
> We recommend to use either the `vX.Y.Z-a.b.c` tags or the `vX.Y-a.b.c` tags in production!
66+
67+
* `vX.Y.Z-a.b.c`, `vX.Y-a.b.c`:
68+
These are release builds containing _NetBox version_ `vX.Y.Z`.
69+
They contain the support files of _NetBox Docker version_ `a.b.c`.
70+
You must use _NetBox Docker version_ `a.b.c` to guarantee the compatibility.
71+
These images are automatically built from [the corresponding releases of NetBox][netbox-releases].
72+
* `latest-a.b.c`:
73+
These are release builds, containing the latest stable version of NetBox.
74+
They contain the support files of _NetBox Docker version_ `a.b.c`.
75+
You must use _NetBox Docker version_ `a.b.c` to guarantee the compatibility.
76+
These images are automatically built from [the `master` branch of NetBox][netbox-master].
77+
* `snapshot-a.b.c`:
78+
These are pre-release builds.
79+
They contain the support files of _NetBox Docker version_ `a.b.c`.
80+
You must use _NetBox Docker version_ `a.b.c` to guarantee the compatibility.
81+
These images are automatically built from the [`develop` branch of NetBox][netbox-develop].
82+
83+
For each of the above tag, there is an extra tag:
84+
85+
* `vX.Y.Z`, `vX.Y`:
86+
This is the same version as `vX.Y.Z-a.b.c` (or `vX.Y-a.b.c`, respectively).
87+
It always points to the latest version of _NetBox Docker_.
88+
* `latest`
89+
This is the same version as `latest-a.b.c`.
90+
It always points to the latest version of _NetBox Docker_.
91+
* `snapshot`
92+
This is the same version as `snapshot-a.b.c`.
93+
It always points to the latest version of _NetBox Docker_.
94+
95+
Then there is currently one extra tags for each of the above tags:
96+
97+
* `-ldap`:
98+
These container images contain additional dependencies and configuration files for connecting NetBox to an LDAP directory.
99+
[Learn more about that in our wiki][netbox-docker-ldap].
100+
101+
[netbox-releases]: https://github.com/netbox-community/netbox/releases
102+
[netbox-master]: https://github.com/netbox-community/netbox/tree/master
103+
[netbox-develop]: https://github.com/netbox-community/netbox/tree/develop
104+
[netbox-branches]: https://github.com/netbox-community/netbox/branches
105+
[netbox-docker-ldap]: https://github.com/netbox-community/netbox-docker/wiki/LDAP
106+
80107
## Documentation
81108

82-
Please refer [to our wiki on Github][netbox-docker-wiki] for further information on how to use this NetBox Docker image properly.
83-
It covers advanced topics such as using files for secrets, deployment to Kubernetes, monitoring and configuring NAPALM or LDAP.
109+
Please refer [to our wiki on Github][netbox-docker-wiki] for further information on how to use the NetBox Docker image properly.
110+
The wiki covers advanced topics such as using files for secrets, configuring TLS, deployment to Kubernetes, monitoring and configuring NAPALM and LDAP.
111+
112+
Our wiki is a community effort.
113+
Feel free to correct errors, update outdated information or provide additional guides and insights.
84114

85115
[netbox-docker-wiki]: https://github.com/netbox-community/netbox-docker/wiki/
86116

@@ -104,22 +134,19 @@ This project relies only on *Docker* and *docker-compose* meeting these requirem
104134

105135
To check the version installed on your system run `docker --version` and `docker-compose --version`.
106136

107-
## Breaking Changes
108-
109-
From time to time it might become necessary to re-engineer the structure of this setup.
110-
Things like the `docker-compose.yml` file or your Kubernetes or OpenShift configurations have to be adjusted as a consequence.
111-
112-
Since November 2019 each image built from this repo contains a `org.opencontainers.image.version` label.
113-
(The images contained labels since April 2018, although in November 2019 the labels' names changed.)
114-
You can check the label of your local image by running `docker inspect netboxcommunity/netbox:v2.7.1 --format "{{json .Config.Labels}}"`.
137+
## Updating
115138

116139
Please read [the release notes][releases] carefully when updating to a new image version.
140+
Note that the version of the NetBox Docker container image must stay in sync with the code.
141+
142+
If you update for the first time, be sure [to follow our _How To Update NetBox Docker_ guide in the wiki][netbox-docker-wiki-updating].
117143

118144
[releases]: https://github.com/netbox-community/netbox-docker/releases
145+
[netbox-docker-wiki-updating]: https://github.com/netbox-community/netbox-docker/wiki/Updating
119146

120147
## Rebuilding the Image
121148

122-
`./build.sh` can be used to rebuild the Docker image. See `./build.sh --help` for more information.
149+
`./build.sh` can be used to rebuild the container image. See `./build.sh --help` for more information.
123150

124151
For more details on custom builds [consult our wiki][netbox-docker-wiki-build].
125152

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.1
1+
1.5.0

build-latest.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33

44
echo "▶️ $0 $*"
55

6+
###
7+
# Check for the jq library needed for parsing JSON
8+
###
9+
if ! command -v jq; then
10+
echo "⚠️ jq command missing from \$PATH!"
11+
exit 1
12+
fi
13+
614
###
715
# Checking for the presence of GITHUB_OAUTH_CLIENT_ID
816
# and GITHUB_OAUTH_CLIENT_SECRET

configuration/configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ def _read_secret(secret_name, default = None):
6262
'PASSWORD': _read_secret('redis_password', environ.get('REDIS_PASSWORD', '')),
6363
'DATABASE': int(environ.get('REDIS_DATABASE', 0)),
6464
'SSL': environ.get('REDIS_SSL', 'False').lower() == 'true',
65+
'INSECURE_SKIP_TLS_VERIFY': environ.get('REDIS_INSECURE_SKIP_TLS_VERIFY', 'False').lower() == 'true',
6566
},
6667
'caching': {
6768
'HOST': environ.get('REDIS_CACHE_HOST', environ.get('REDIS_HOST', 'localhost')),
6869
'PORT': int(environ.get('REDIS_CACHE_PORT', environ.get('REDIS_PORT', 6379))),
6970
'PASSWORD': _read_secret('redis_cache_password', environ.get('REDIS_CACHE_PASSWORD', environ.get('REDIS_PASSWORD', ''))),
7071
'DATABASE': int(environ.get('REDIS_CACHE_DATABASE', 1)),
7172
'SSL': environ.get('REDIS_CACHE_SSL', environ.get('REDIS_SSL', 'False')).lower() == 'true',
73+
'INSECURE_SKIP_TLS_VERIFY': environ.get('REDIS_CACHE_INSECURE_SKIP_TLS_VERIFY', environ.get('REDIS_INSECURE_SKIP_TLS_VERIFY', 'False')).lower() == 'true',
7274
},
7375
}
7476

docker-compose.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- ./scripts:/etc/netbox/scripts:z,ro
1919
- netbox-media-files:/opt/netbox/netbox/media:z
2020
postgres:
21-
image: postgres:13-alpine
21+
image: postgres:14-alpine
2222
env_file: env/postgres.env
2323
redis:
2424
image: redis:6-alpine

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.4'
22
services:
33
netbox: &netbox
4-
image: netboxcommunity/netbox:${VERSION-v3.0-1.4.1}
4+
image: netboxcommunity/netbox:${VERSION-v3.1-1.5.0}
55
depends_on:
66
- postgres
77
- redis
@@ -35,7 +35,7 @@ services:
3535

3636
# postgres
3737
postgres:
38-
image: postgres:13-alpine
38+
image: postgres:14-alpine
3939
env_file: env/postgres.env
4040
volumes:
4141
- netbox-postgres-data:/var/lib/postgresql/data

docker/configuration.docker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,10 @@ def __getattr__(name):
8282
except:
8383
pass
8484
raise AttributeError
85+
86+
87+
def __dir__():
88+
names = []
89+
for config in _loaded_configurations:
90+
names.extend(config.__dir__())
91+
return names

env/netbox.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ NAPALM_TIMEOUT=10
2323
NAPALM_USERNAME=
2424
REDIS_CACHE_DATABASE=1
2525
REDIS_CACHE_HOST=redis-cache
26+
REDIS_CACHE_INSECURE_SKIP_TLS_VERIFY=false
2627
REDIS_CACHE_PASSWORD=t4Ph722qJ5QHeQ1qfu36
2728
REDIS_CACHE_SSL=false
2829
REDIS_DATABASE=0
2930
REDIS_HOST=redis
31+
REDIS_INSECURE_SKIP_TLS_VERIFY=false
3032
REDIS_PASSWORD=H733Kdjndks81
3133
REDIS_SSL=false
3234
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases

requirements-container.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
napalm==3.3.1
2-
ruamel.yaml==0.17.16
2+
ruamel.yaml==0.17.17
33
django-auth-ldap==3.0.0
44
google-crc32c==1.3.0
5-
django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.12.1
5+
django-storages[azure,boto3,dropbox,google,libcloud,sftp]==1.12.3

startup_scripts/010_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818

1919
if user:
2020
group.user_set.add(user)
21-
print(" 👤 Assigned user %s to group %s" % (username, AdminGroup.name))
21+
print(" 👤 Assigned user %s to group %s" % (username, group.name))
2222

2323
group.save()

0 commit comments

Comments
 (0)