magnetico/Dockerfile.magneticod

29 lines
1.0 KiB
Docker
Raw Normal View History

2018-08-27 10:15:01 +02:00
# 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.11-alpine AS build
RUN apk add --no-cache build-base curl git
2018-08-27 10:15:01 +02:00
# 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 magneticod
FROM alpine:latest
WORKDIR /
COPY --from=build /go/bin/magneticod /magneticod
2018-08-27 10:15:01 +02:00
# Run the outyet command by default when the container starts.
ENTRYPOINT ["/magneticod"]