magnetico/Dockerfile.magneticow

31 lines
933 B
Docker
Raw Normal View History

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-09-18 02:21:30 +02:00
FROM golang:1.13-alpine AS build
WORKDIR /magnetico
2019-05-19 02:27:10 +02:00
RUN export PATH=$PATH:/go/bin
RUN apk add --no-cache build-base curl git
2019-09-18 02:21:30 +02:00
RUN go get -u github.com/kevinburke/go-bindata/...
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/magneticow /magnetico/cmd/magneticow
2018-08-27 10:15:01 +02:00
RUN make magneticow
FROM alpine:latest
2019-05-19 02:27:10 +02:00
LABEL maintainer="bora@boramalper.org"
2019-09-18 02:21:30 +02:00
# the service listens on port 8080
EXPOSE 8080
WORKDIR /
2019-09-18 02:21:30 +02:00
VOLUME /root/.local/share/magneticod
2019-09-18 02:21:30 +02:00
RUN mkdir -p "/root/.config/magneticow/"
RUN echo 'magnetico:$2y$06$8VzJvXegA2X/tfmTXN7NM.FH5HRh8fbvXUmrtW52xLH5JNDhldexG' > "/root/.config/magneticow/credentials"
2019-05-19 02:27:10 +02:00
2019-09-18 02:21:30 +02:00
COPY --from=build /go/bin/magneticow /magneticow
2018-08-27 10:15:01 +02:00
2019-09-18 02:21:30 +02:00
ENTRYPOINT ["/magneticow"]