magnetico/Dockerfile.magneticow
2018-11-25 17:54:31 +01:00

32 lines
1.1 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/magneticow /go/src/github.com/boramalper/magnetico/cmd/magneticow
# 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-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.
ENTRYPOINT ["/magneticow"]
# Document that the service listens on port 8080.
EXPOSE 8080