jamesnetherton / homehub-cli

CLI for the BT Home Hub router
MIT License
37 stars 5 forks source link

Add Dockerfile for building a Docker container #16

Closed Tenzer closed 6 years ago

Tenzer commented 6 years ago

A two-step process is used in order to have a minimal image as the end result. The resulting image is 7 MB in size and only contains the homehub-cli binary.

Quick test after building the image locally:

[jeppe@reventon ~]$ docker run --rm homehub About
Version:            0.5.0
Compatible with:    SG4B1000B316
Build date:         11/01/2018
Revision:           99fc4f9
[jeppe@reventon ~]$ docker run --rm homehub Version --password=$PASS
Home Hub 60 Type A
[jeppe@reventon ~]$ docker run --rm homehub SoftwareVersion --password=$PASS
SG4B1000B316

Fixes #15.

Tenzer commented 6 years ago

It would probably be ideal if the password could be provided with an environment variable, along with the hub URL in case it's not the default.

jamesnetherton commented 6 years ago

Thanks so much for this! I gave it a quick spin and it works great.

I was thinking the same thing about allowing params to be configured via environment variables. But I'll merge this as-is now and try to cut a new release at the weekend which includes the Docker image.