Skip to content

Add Dockerfile and requirements.txt #11

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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.

2 participants