commit
786c72c3ad
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
# Start from a Debian image with the latest version of Go installed
|
# Start from a Debian image with the latest version of Go installed
|
||||||
# and a workspace (GOPATH) configured at /go.
|
# and a workspace (GOPATH) configured at /go.
|
||||||
FROM golang:1.10
|
FROM golang:1.10-alpine AS build
|
||||||
|
|
||||||
|
RUN apk add --no-cache build-base curl git
|
||||||
|
|
||||||
# Copy the local package files to the container's workspace.
|
# Copy the local package files to the container's workspace.
|
||||||
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/
|
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/
|
||||||
@ -16,13 +18,11 @@ ADD ./cmd/magneticod /go/src/github.com/boramalper/magnetico/cmd/magneticod
|
|||||||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||||
WORKDIR /go/src/github.com/boramalper/magnetico/
|
WORKDIR /go/src/github.com/boramalper/magnetico/
|
||||||
RUN make ensure
|
RUN make ensure
|
||||||
RUN make test-persistence
|
|
||||||
RUN make test-magneticod
|
|
||||||
RUN make magneticod
|
RUN make magneticod
|
||||||
|
|
||||||
# Run the outyet command by default when the container starts.
|
FROM alpine:latest
|
||||||
ENTRYPOINT ["/go/bin/magneticod"]
|
WORKDIR /
|
||||||
CMD []
|
COPY --from=build /go/bin/magneticod /magneticod
|
||||||
|
|
||||||
# Document that the service listens on port 8080.
|
# Run the outyet command by default when the container starts.
|
||||||
EXPOSE 8080
|
ENTRYPOINT ["/magneticod"]
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
# Start from a Debian image with the latest version of Go installed
|
# Start from a Debian image with the latest version of Go installed
|
||||||
# and a workspace (GOPATH) configured at /go.
|
# and a workspace (GOPATH) configured at /go.
|
||||||
FROM golang:1.10
|
FROM golang:1.10-alpine AS build
|
||||||
|
|
||||||
|
RUN apk add --no-cache build-base curl git
|
||||||
|
|
||||||
# Copy the local package files to the container's workspace.
|
# Copy the local package files to the container's workspace.
|
||||||
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/
|
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/
|
||||||
@ -16,13 +18,14 @@ ADD ./cmd/magneticow /go/src/github.com/boramalper/magnetico/cmd/magneticow
|
|||||||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||||
WORKDIR /go/src/github.com/boramalper/magnetico/
|
WORKDIR /go/src/github.com/boramalper/magnetico/
|
||||||
RUN make ensure
|
RUN make ensure
|
||||||
RUN make test-persistence
|
|
||||||
RUN make test-magneticow
|
|
||||||
RUN make magneticow
|
RUN make magneticow
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=build /go/bin/magneticow /magneticow
|
||||||
|
|
||||||
# Run the outyet command by default when the container starts.
|
# Run the outyet command by default when the container starts.
|
||||||
ENTRYPOINT ["/go/bin/magneticow"]
|
ENTRYPOINT ["/magneticow"]
|
||||||
CMD []
|
|
||||||
|
|
||||||
# Document that the service listens on port 8080.
|
# Document that the service listens on port 8080.
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
1
Makefile
1
Makefile
@ -22,6 +22,7 @@ image: image-magneticod image-magneticow
|
|||||||
# Download dependencies
|
# Download dependencies
|
||||||
ensure:
|
ensure:
|
||||||
dep ensure -v
|
dep ensure -v
|
||||||
|
go get -u github.com/kevinburke/go-bindata/...
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
go vet github.com/boramalper/magnetico/...
|
go vet github.com/boramalper/magnetico/...
|
||||||
|
Loading…
Reference in New Issue
Block a user