Commit Graph

43 Commits

Author SHA1 Message Date
Christian Mäder
20109c3392 Checkout the repository with git
This changes the build process even further. Instead
f using `wget` to fetch the current code, `git` is used.
This allows for faster switching between branches,
because only the differences between them have to be
fetched from the server.

But the main advantage is that the build cache can
finally be used as designed by Docker. Repetitive
builds are very fast now. This is also true between
branches and tags, as long as the `requirements.txt`
file doesn't change.
2019-10-15 00:34:15 +02:00
Christian Mäder
f3b9c34e3b externalize netbox download with wget 2019-10-15 00:34:15 +02:00
Christian Mäder
d0ebb34432 Refactor to multistage builds
This commit introduces a huge change in the build process.

What changed:

- Dockerfile.ldap was integrated into Dockerfile as a seperate
  [build stage][multistage-build].
- All the build scripts were refactored according to this.
- The `docker-compose.yml` file was adjusted likewise.
- The main build script, `/build.sh`, now always builds all
  targets (formerly called variants).
- The minimal requirements for Docker and docker-compose
  have increased.
- The build on hub.docker.com must be adjusted.

This change should also fix #156 permanently.

[multistage-build]: https://docs.docker.com/develop/develop-images/multistage-build/
2019-10-15 00:34:15 +02:00
takumin
7f22d21d5d fix AttributeError for ruamel.yaml 2019-07-30 20:09:02 +09:00
Tobias Genannt
135d29e06f Update base image
This updates the base image to Alpine 3.10 with Python 3.7
2019-07-05 08:22:25 +02:00
Christian Mäder
dc3db2d9fd %s/digitalocean/netbox-community/gi
Thank you Digitalocean for sponsoring Netbox!
And thank you for letting it grow up and move out ;)
2019-07-02 21:32:58 +02:00
Christian Mäder
dfd30f5eae Explain caching strategy in Dockerfile comments 2019-06-12 17:53:35 +02:00
Robert Ellegate
a086c2fc22
Changing REF_URL to use HEAD/TAG agnostic API
Per [dicsuccion](https://github.com/netbox-community/netbox-docker/pull/137#issuecomment-495667921) with @cimnine, changing the API endpoint to one that retains functionality of previous URL while supporting both HEADS and TAGS
2019-05-28 10:45:10 -04:00
Robert Ellegate
e33a2d2c0a
Adding REF to GitHub repo HEAD for cache busting
After installing requirements, check if  HEAD has changed and bust cache for RUN instruction for wget  archive
2019-05-23 11:20:39 -04:00
Christian Mäder
821fb5f36e Caching of requirements.txt
After [a discussion][1] with rje6459 on the networktocode Slack
in the #netbox-docker channel we've come up with a small improvement
to those that regularly have to build netbox docker locally.

It fetches the "requirements.txt" from the desired branch before
downloading netbox itself.

[1]: https://networktocode.slack.com/archives/CD23LP8BC/p1558537080023200
2019-05-22 18:05:54 +02:00
Christian Mäder
6c3db3deff Update django to 2.2 2019-05-09 09:57:01 +02:00
Christian Mäder
582064f4cd
Loosen version pinning for Django
This change is in accordance with https://github.com/digitalocean/netbox/issues/2808
2019-02-22 13:52:37 +01:00
Tobias Genannt
2450a70ca8 Update Alpine
This updates to the newest stable version (Alpine 3.9)
2019-02-21 15:30:40 +01:00
Tobias Genannt
ab72ba10c2 Update Alpine
This updates to the newest stable version (Alpine 3.8)
2018-09-14 09:43:09 +02:00
Christian Mäder
2b3f831749
Don't lock Django to explicit version
... but rather use the same definition that is currently used in
Netbox's `requirements.txt`.
2018-08-14 10:08:34 -07:00
Christian Mäder
013f81b791
♻️ Make netbox-worker it's own container
One container should ideally have one responsibility [1]. Therefore I
implemented the netbox-worker to start in it's own container. This is
possible, because netbox and the worker communicate via redis anyway.

They still use the same image underneath, just the "command" they
execute while starting different.

Or in other words: I see no reason to introduce supervisord, when we
already have docker-compose which can take care of running multiple
processes.

Also, here's another benefit: Now it's possible to view the logs of the
webhook worker independently of the other netbox logs (and vice-versa).

Other changes in this commit:
* I don't see a reason to put a password for Redis in the docker-compose
  setup, so I removed it.
* Slightly changed the nginx config, so that the nginx startup command
  becomes simpler and any error should be visible in the docker log.
* Some housekeeping in the `Dockerfile`.
* Added some troubleshooting advice regarding webhooks to the README.

I'd like to thank Brady (@bdlamprecht [2]) here who did the harder
work of figuring out what's even required to have webhooks working. [3]

[1] 
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#decouple-applications
[2] https://github.com/bdlamprecht
[3] https://github.com/ninech/netbox-docker/pull/90
2018-08-13 14:04:09 -07:00
Brady Lamprecht
b88974ef9f Working implementation of webhooks using new 'redis' container 2018-08-10 17:55:09 -06:00
Tobias Genannt
5e5cc13a05 Update to Alpine 3.7
Because the tag "python:3.6-alpine" points to Alpine 3.4 which is now
end of life (as of 2018-05-01) the image now pulls the Alpine 3.7 python
image
2018-05-09 09:52:33 +02:00
Tobias Genannt
b46bd58e0a
Move config to /etc/netbox/config (Fixes #54)
With this the configuration is moved to /etc/netbox/config and the
default reports directory is set to /etc/netbox/reports. This enables
the user to mount reports from a config map or persistent volume in
OpenShift.
2018-04-04 10:13:30 +02:00
Christian Mäder
f56a79381b
Introduces a Netbox Docker project version 2018-04-04 09:44:58 +02:00
Brady Lamprecht
07b1b4675c
Adding in support for NAPALM 2018-03-08 09:38:43 +01:00
Tobias Genannt
2a1b6e42a8 Externalize gunicorn-config
This moves the gunicorn_config.py into /etc/netbox so that it can be
easily mapped through a Openshift config map
2018-03-07 14:57:56 +01:00
Tobias Genannt
ef76e4e8ea Modifications for Openshift
With these modifications the netbox containers can run on Openshift.
The configuration files can be imported from a config map to the
'/etc/netbox' directory and will be loaded from there.
2018-02-22 17:22:04 +01:00
Christian Mäder
2d6388b489
🐞 Be More Explicit On Paths 2018-02-16 10:49:34 +01:00
Christian Mäder
43cb9f7e50
Include Initializers
Initializers are startup scripts for common tasks like creating custom
fields. These are problems many users of Netbox Docker potentially face
and are therefore worth sharing.
2018-02-16 10:25:51 +01:00
Christian Mäder
fe05ca5c7c
❇️ Adds new options to the build script 2018-02-02 12:48:38 +01:00
nathbooth
2aa582f3ce
Added ttf-ubuntu-font-family
The present build does not include a font-family causing Graphviz to render text as blank squares, including the ttf  ubuntu font-family means text is rendered correctly
2017-12-01 09:27:30 +00:00
Christian Mäder
94746ac5de
🐞 The upstream repo remove the docker config
.. so I copied it over to this repo.
2017-10-13 10:10:43 +02:00
Christian Mäder
38a1c4c7f2
Removes workaround for Django Rest Framework 2017-10-12 15:36:19 +02:00
misazr
167f816b94 Add description for library 2017-10-10 11:14:16 +02:00
misazr
4576531634 Set right version of django rest framework 2017-10-10 09:56:10 +02:00
Christian Mäder
d58930ab67
🐳 Adds the possibility to overwrite the CMD 2017-08-30 11:10:15 +02:00
Christian Mäder
ab0c255040
🐳 Change to the actual workdir 2017-08-30 11:09:24 +02:00
Christian Mäder
822350d666
🔼 Introduces a more recent gunicorn 2017-08-30 11:08:21 +02:00
Christian Mäder
4ce4373eb0
🐳 By default, build latest from the master branch 2017-08-30 11:07:28 +02:00
Christian Mäder
552227cca4
Updates default Docker build branch to a stable version 2017-06-19 09:30:24 +02:00
Christian Mäder
1072d243a3
Fixes logging config that prevented gunicon launch 2017-06-19 09:24:35 +02:00
Christian Mäder
c1e88f81ac
Switch to python 3 2017-06-09 08:38:55 +02:00
Christian Mäder
128c63de2b
Merge remote-tracking branch 'chrigl/fix-add-nginx-conf' 2017-05-10 16:55:35 +02:00
Christoph Glaubitz
72726b2253 Added nginx.conf netbox image
Without it, the nginx container of the docker-compose.yml refuses to
start.
2017-05-09 10:12:36 +02:00
Christian Mäder
898683eeb2
Updated for v2.0-beta3 2017-04-28 08:17:22 +02:00
Christian Mäder
1e96f5a191
Reworked the Dockerfile with alpinelinux 2017-04-21 13:45:34 +02:00
Jeremy Stretch
582b2abea8 Copied Docker components from main repo 2017-04-19 10:48:21 -04:00