Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to multistage builds #159

Merged
merged 15 commits into from
Oct 15, 2019
Merged

Refactor to multistage builds #159

merged 15 commits into from
Oct 15, 2019

Conversation

cimnine
Copy link
Collaborator

@cimnine cimnine commented Oct 10, 2019

This PR contains a big refactoring of the build process and how variants work.

Notable Changes

  • Dockerfile.ldap was integrated into Dockerfile as a seperate
    build stage.
  • The code to fetch the Netbox source was extracted from the Dockerfile. This is now handled by the build script.
  • 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), i.e. 'main' and 'ldap'.
  • The minimal requirements for Docker and docker-compose
    have increased.
  • Test builds for Pull Requests are now possible.
  • The images are now less than 100mb most of the time.
  • The build speed was improved, especially if a Docker Cache is available.

This change should also fix #156 permanently.

TODO

@cimnine cimnine added discussion This issue requires further input from the community. enhancement The issue describes an enhancement that we would like to implement in the future. labels Oct 11, 2019
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/
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.
The Docker Hub build system runs on Ubuntu Xenial containers.
Xenial's git is 2.7.4, which does not know the `-P` flag yet.
@cimnine cimnine merged commit ef98928 into master Oct 15, 2019
@cimnine cimnine deleted the multistage-build branch October 15, 2019 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This issue requires further input from the community. enhancement The issue describes an enhancement that we would like to implement in the future.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No v2.6.3-ldap image on Docker Hub
1 participant