Merge pull request #5 from hpdvanwyk/dockerfile

Dockerfile
This commit is contained in:
Hendrik van Wyk
2019-01-19 18:07:29 +02:00
committed by GitHub
3 changed files with 25 additions and 2 deletions

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM golang:alpine as builder
RUN apk add build-base linux-headers git
RUN mkdir /build
ADD . /build/
WORKDIR /build
RUN go build -o invertergui ./cmd/invertergui
FROM alpine
RUN adduser -S -D -H -h /app inverteruser
RUN addgroup inverteruser dialout
USER inverteruser
COPY --from=builder /build/invertergui /app/
WORKDIR /app
ENTRYPOINT [ "./invertergui" ]
CMD []

View File

@@ -26,7 +26,7 @@
#OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.PHONY: test install gofmt
.PHONY: test install gofmt docker
build:
go build ./cmd/invertergui/
@@ -45,3 +45,6 @@ test-race:
vet:
go vet ./...
docker:
docker build --tag invertergui .

View File

@@ -2,7 +2,13 @@
The invertergui allows the monitoring of a [Victron Multiplus](https://www.victronenergy.com/inverters-chargers/multiplus-12v-24v-48v-800va-3kva) via the [MK3/MK2 USB](https://www.victronenergy.com/accessories/interface-mk3-usb) or the MK2 RS232.
The `ncthompson/invertergui` docker image is a build of [invertergui](https://gitlab.com/ncthompson/invertergui)
The [`ncthompson/invertergui`](https://hub.docker.com/r/ncthompson/invertergui) docker image is a build of this repository.
## Quick Start
```
docker run --device /dev/ttyUSB0:/dev/ttyUSB0 -p 8080:8080 ncthompson/invertergui
```
## Requirements