-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 856 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (28 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM reg.deeproute.ai/deeproute-public/go/golang:alpine as builder
ARG TYPE
ENV GOBIN=/go/bin
ENV GOPATH=/go/src
RUN mkdir /build
WORKDIR /build
RUN apk add --upgrade git
RUN go version
# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
RUN go mod download
ADD . /build/
RUN echo $TYPE
RUN cd /build/cmd/$TYPE; go build -o main .
FROM reg.deeproute.ai/deeproute-public/alpine:latest
ARG TYPE
LABEL maintainer="Liang Zheng<liangzheng0901@gmail.com>"
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="goroom-$TYPE" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/microyahoo/data-migrate" \
org.label-schema.schema-version="1.0"
RUN adduser -S -D -H -h /app appuser
USER appuser
COPY --from=builder /build/cmd/$TYPE/main /app/
WORKDIR /app
ENTRYPOINT ["./main"]