netprobe_lite icon indicating copy to clipboard operation
netprobe_lite copied to clipboard

Add Portrainer support and multi arch build pipeline

Open Xian55 opened this issue 9 months ago • 4 comments

Hello, good day. I just wanted to let you know that, i've managed to make the project deployable in Portrainer under arm32v7 arch.

I had to do some major reorganizing changes in order to make this happen. I think in the long term the project certainly benefits from it.

You may accept or deny this PR. My only goal was to make the project working on my small arm based odroid xu4, which runs 24/7 runs on very low power. However i highly suggest to check out my changes in order to understand what kind of changes needed to be made for Portrainer Stack support.

I wish for the best moving forward with the project, i really like the idea not to mention its quite handy when your ISP doing questionable things.

Changes:

  • Create a build pipeline(build_publish.sh) for making multi arch manifest including AMD64, ARM32V7, ARM64V8 result can be seen here.
  • Reorganized the project to better use Dockerfile COPY. Moved all of the source does under the /src folder.
  • docker-compose.yml no longer mounts the source code into the container directly but rather creates a Dockerfile COPY of the /src folder.
  • Maintainability reasons, docker-compose.yml no longer mounts single files, but rather mounts the parent folder.
  • Added more syntax highlight to the README.md file.
  • Added .dockerignore to the project specific to python projects.
  • In the Dockerfile the MAJOR.MINOR python version can be set via $PYTHON_VERSION more info in build.env
  • With these changes the project can be deployed in Portrainer even under arm linux.
  • For local build using docker-compose.yml and docker-compose.override.yml.
  • Added the ability to build multiple arch and python version number in Dockerfile.
  • Fixed an issue where no entrypoint.sh found while deploying Portrainer, used wrong image file on linux.
  • Be sure that entrypoint.sh has executable permission.
  • Config_Netprobe.speedtest_enabled is considered in netprobe_speedtest.py
  • Added custom logging alias for /logs folder - volume can be mounted so the logs are persisted on the host machine.
  • if Config_Netprobe.speedtest_enabled is set to False the speedtest container spins up and exists immediately.
  • Updated readme.md for how to build and publish docker image to docker hub.

Tested my changes:

  • Windows 10 - the windows developer experience did not changed much. Using the following command docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build this should give more flexibility what kind of customization each consumer want to implement.
  • Linux Debian 10 buster - arm32v7 - deploying the app using Portrainer, more info in the README.md

Recommended subject around the topic:

  • https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/

Xian55 avatar May 20 '24 00:05 Xian55