Skip to content

Conversation

@robrankin
Copy link
Contributor

Added a Dockerfile as it's handy to have for environments that containerise everything.

Copy link

@harryhaaren harryhaaren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi All (Harry here - not the author of the project - but was using the script for grabbing stats (thanks to original author!) so figured I'd try contribute a bit.

PR here looks good, build the image and tested - works perfectly. docker build . results in a valid image, and docker run <image_id> gives the normal "usage" output as expected, same as the script gives "on baremetal". Adding valid switch IP and password, both work find.

One potential improvement is to use a minimalized base for the script? Today's image is ~1GB (!) which seems very large for a simple dockerized python3+script? Usually Alpine is a better/smaller image base, it seems the official Python image folks make an alpine version available too (link), which reduces the total image to ~60MB :)

python:3
<none>          <none>            578cb428b665   7 minutes ago   1.03GB

python:alpine3.20
<none>          <none>            4a5788ce332c   2 seconds ago   59.8MB

The following diff will change the Dockerfile to the new image:

diff --git a/Dockerfile b/Dockerfile
index 55f6ccf..0bd850e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3
+FROM python:alpine3.20
 
 WORKDIR /essstat

@psmode psmode merged commit 382fe55 into psmode:master Aug 20, 2025
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes to thei script, so no need to increment version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants