forked from cloud-barista/cb-spider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (28 loc) · 1.32 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
##############################################################
## Stage 1 - Go Build
##############################################################
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache bash
#RUN apk add gcc
ADD . /go/src/github.com/cloud-barista/cb-spider
WORKDIR /go/src/github.com/cloud-barista/cb-spider
#RUN ./build_all_driver_lib.sh
WORKDIR api-runtime/rest-runtime
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -extldflags "-static"' -tags cb-spider -o cb-spider -v
#############################################################
## Stage 2 - Application Setup
##############################################################
FROM ubuntu:latest
# use bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
WORKDIR /app
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/cloud-driver-libs/* /app/cloud-driver-libs/
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/conf/* /app/conf/
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/api-runtime/rest-runtime/cb-spider /app/api-runtime/rest-runtime/
#COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/setup.env /app/
#RUN /bin/bash -c "source /app/setup.env"
ENV CBSPIDER_ROOT /app
ENV CBSTORE_ROOT /app
ENV CBLOG_ROOT /app
ENTRYPOINT [ "/app/api-runtime/rest-runtime/cb-spider" ]
EXPOSE 1024