[PR #478] [MERGED] Changes to Dockerfile to make the build faster #12063

Closed
opened 2025-12-29 22:19:25 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/478
Author: @rfdrake
Created: 8/17/2016
Status: Merged
Merged: 8/18/2016
Merged by: @jeremystretch

Base: developHead: develop


📝 Commits (1)

  • 6ed33af Changes to Dockerfile to make the build faster

📊 Changes

2 files changed (+7 additions, -20 deletions)

View changed files

📝 Dockerfile (+6 -20)
📝 requirements.txt (+1 -0)

📄 Description

To download a new version with docker, I've been running

git pull
docker-compose build --no-cache

This is slow, but no-cache is needed so that "git clone" pulls the
latest copy.

Most of the slowness comes from pulling down apt files each time a
rebuild needs to be done. If we move that into a docker image then only
the local changes need to be rebuilt.

Further refinements could be done. If the python dependencies that are
brought in from requirements.txt could be moved to an image then nothing
would change between updates as long as dependant versions hadn't
changed. This would probably be more trouble than it's worth, unless
you're recreating netbox containers 10-20 times a day.

This rebases #436 and supercedes #477


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/478 **Author:** [@rfdrake](https://github.com/rfdrake) **Created:** 8/17/2016 **Status:** ✅ Merged **Merged:** 8/18/2016 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (1) - [`6ed33af`](https://github.com/netbox-community/netbox/commit/6ed33af0636e48d4bd9e834b6c9ab79233807aa4) Changes to Dockerfile to make the build faster ### 📊 Changes **2 files changed** (+7 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+6 -20) 📝 `requirements.txt` (+1 -0) </details> ### 📄 Description To download a new version with docker, I've been running ``` git pull docker-compose build --no-cache ``` This is slow, but no-cache is needed so that "git clone" pulls the latest copy. Most of the slowness comes from pulling down apt files each time a rebuild needs to be done. If we move that into a docker image then only the local changes need to be rebuilt. Further refinements could be done. If the python dependencies that are brought in from requirements.txt could be moved to an image then nothing would change between updates as long as dependant versions hadn't changed. This would probably be more trouble than it's worth, unless you're recreating netbox containers 10-20 times a day. This rebases #436 and supercedes #477 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:19:25 +01:00
adam closed this issue 2025-12-29 22:19:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12063