forked from cloud-barista/cb-ladybug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (21 loc) · 779 Bytes
/
Dockerfile
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
#-------------------------------------------
# STEP 1 : build executable binary
#-------------------------------------------
FROM golang:1.15.3-alpine3.12 as builder
# gcc
RUN apk add --no-cache build-base
ADD . /usr/src/app
WORKDIR /usr/src/app
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags '-w -extldflags "-static"' -tags cb-ladybug -o cb-ladybug -v src/main.go
#-------------------------------------------
# STEP 2 : build a image
#-------------------------------------------
FROM scratch
COPY --from=builder /usr/src/app/conf/* /app/conf/
COPY --from=builder /usr/src/app/cb-ladybug /app/
COPY --from=builder /usr/src/app/src/scripts/* /app/src/scripts/
ENV CBLOG_ROOT "/app"
ENV CBSTORE_ROOT "/app"
ENV APP_ROOT "/app"
ENTRYPOINT [ "/app/cb-ladybug" ]
EXPOSE 8080