[PR #436] [CLOSED] Changes to Dockerfile to make the build faster #12057

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/436
Author: @rfdrake
Created: 8/6/2016
Status: Closed

Base: developHead: develop


📝 Commits (1)

  • 98be93e Changes to Dockerfile to make the build faster

📊 Changes

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

View changed files

📝 Dockerfile (+5 -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 dependent 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.

I had to test this in a limited way. I'd appreciate feedback if it breaks something.


🔄 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/436 **Author:** [@rfdrake](https://github.com/rfdrake) **Created:** 8/6/2016 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (1) - [`98be93e`](https://github.com/netbox-community/netbox/commit/98be93e3bd198348b5f5bf52bffdb3eb4771898d) Changes to Dockerfile to make the build faster ### 📊 Changes **2 files changed** (+6 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+5 -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 dependent 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. I had to test this in a limited way. I'd appreciate feedback if it breaks something. --- <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:23 +01:00
adam closed this issue 2025-12-29 22:19:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12057