2018-08-27 10:15:01 +02:00
|
|
|
# Start from a Debian image with the latest version of Go installed
|
|
|
|
# and a workspace (GOPATH) configured at /go.
|
2019-05-19 02:27:10 +02:00
|
|
|
FROM golang:1.12-alpine AS build
|
2018-11-25 18:46:49 +01:00
|
|
|
|
|
|
|
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.
|
2019-05-19 02:27:10 +02:00
|
|
|
ADD ./Makefile /magnetico/
|
|
|
|
ADD ./pkg /magnetico/pkg
|
|
|
|
ADD ./go.mod /magnetico/go.mod
|
|
|
|
ADD ./cmd/magneticod /magnetico/cmd/magneticod
|
2018-08-27 10:15:01 +02:00
|
|
|
|
2019-05-19 02:27:10 +02:00
|
|
|
WORKDIR /magnetico/
|
2018-08-27 10:15:01 +02:00
|
|
|
RUN make magneticod
|
|
|
|
|
2018-11-25 17:51:57 +01:00
|
|
|
FROM alpine:latest
|
2019-05-19 02:27:10 +02:00
|
|
|
LABEL maintainer="bora@boramalper.org"
|
2018-11-25 17:51:57 +01:00
|
|
|
WORKDIR /
|
|
|
|
COPY --from=build /go/bin/magneticod /magneticod
|
2018-08-27 10:15:01 +02:00
|
|
|
|
2019-05-19 02:27:10 +02:00
|
|
|
RUN adduser -D -S magnetico
|
|
|
|
USER magnetico
|
|
|
|
|
2018-11-25 17:51:57 +01:00
|
|
|
ENTRYPOINT ["/magneticod"]
|