Skip to content
Snippets Groups Projects
Commit b7b3e5cf authored by Niall Sheridan's avatar Niall Sheridan
Browse files

Use multi-stage build with current Go version

parent 44620690
Branches
Tags
No related merge requests found
FROM golang:1.7-alpine
FROM golang:latest as build
LABEL maintainer="nsheridan@gmail.com"
ARG SRC_DIR=/go/src/github.com/nsheridan/cashier
WORKDIR ${SRC_DIR}
ADD . ${SRC_DIR}
RUN CGO_ENABLED=0 GOOS=linux go install -a -installsuffix static ./cmd/cashierd
ADD . /go/src/github.com/nsheridan/cashier
RUN apk add --update build-base
RUN go install github.com/nsheridan/cashier/cmd/cashierd
VOLUME /cashier
FROM scratch
LABEL maintainer="nsheridan@gmail.com"
WORKDIR /cashier
ENTRYPOINT /go/bin/cashierd
COPY --from=build /go/bin/cashierd /
ENTRYPOINT ["/cashierd"]
......@@ -5,6 +5,7 @@
- [Cashier](#cashier)
- [How it works](#how-it-works)
- [Installing](#installing)
- [Docker](#docker)
- [Requirements](#requirements)
- [Server](#server)
- [Client](#client)
......@@ -67,6 +68,12 @@ The server requires a configuration file ([sample config](example-server.conf)).
See [the configuration section](#configuration) for more detail.
## Docker
A [docker image is available](https://hub.docker.com/r/nsheridan/cashier). Example usage:
```
docker run -it --rm -p 10000:10000 --name cashier -v ${PWD}:/cashier nsheridan/cashier
```
# Requirements
## Server
Go 1.10 or later, though it may work with earlier versions.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment