29 lines
1.0 KiB
Docker
29 lines
1.0 KiB
Docker
# Source: https://blog.golang.org/docker
|
|
|
|
# Start from a Debian image with the latest version of Go installed
|
|
# and a workspace (GOPATH) configured at /go.
|
|
FROM golang:1.10 AS build
|
|
|
|
# Copy the local package files to the container's workspace.
|
|
ADD ./Gopkg.toml /go/src/github.com/boramalper/magnetico/
|
|
ADD ./Makefile /go/src/github.com/boramalper/magnetico/
|
|
ADD ./pkg /go/src/github.com/boramalper/magnetico/pkg
|
|
ADD ./cmd/magneticod /go/src/github.com/boramalper/magnetico/cmd/magneticod
|
|
|
|
# Build the outyet command inside the container.
|
|
# (You may fetch or manage dependencies here,
|
|
# either manually or with a tool like "godep".)
|
|
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
WORKDIR /go/src/github.com/boramalper/magnetico/
|
|
RUN make ensure
|
|
RUN make test-persistence
|
|
RUN make test-magneticod
|
|
RUN make magneticod
|
|
|
|
FROM alpine:latest
|
|
WORKDIR /
|
|
COPY --from=build /go/bin/magneticod /magneticod
|
|
|
|
# Run the outyet command by default when the container starts.
|
|
ENTRYPOINT ["/magneticod"]
|