forked from cloud-barista/cb-spider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (38 loc) · 2.15 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
##############################################################
## Stage 1 - Go Build
##############################################################
#FROM golang:alpine AS builder
FROM golang:1.21 AS builder
ENV GO111MODULE on
#RUN apk update && apk add --no-cache bash
#RUN apt update
#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
RUN GOOS=linux go build -tags cb-spider -o cb-spider -v
#############################################################
## Stage 2 - Application Setup
##############################################################
FROM ubuntu:latest as prod
RUN apt update
RUN apt install -y ca-certificates
# use bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
WORKDIR /root/go/src/github.com/cloud-barista/cb-spider
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/cloud-driver-libs/ /root/go/src/github.com/cloud-barista/cb-spider/cloud-driver-libs/
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/conf/ /root/go/src/github.com/cloud-barista/cb-spider/conf/
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/api-runtime/cb-spider /root/go/src/github.com/cloud-barista/cb-spider/api-runtime/
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/api-runtime/rest-runtime/admin-web/images/cb-spider-circle-logo.png /root/go/src/github.com/cloud-barista/cb-spider/api-runtime/rest-runtime/admin-web/images/
COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/api-runtime/rest-runtime/admin-web/html/ /root/go/src/github.com/cloud-barista/cb-spider/api-runtime/rest-runtime/admin-web/html/
#COPY --from=builder /go/src/github.com/cloud-barista/cb-spider/setup.env /root/go/src/github.com/cloud-barista/cb-spider/
#RUN /bin/bash -c "source /root/go/src/github.com/cloud-barista/cb-spider/setup.env"
ENV CBSPIDER_ROOT /root/go/src/github.com/cloud-barista/cb-spider
ENV CBLOG_ROOT /root/go/src/github.com/cloud-barista/cb-spider
ENV PLUGIN_SW OFF
ENV MEERKAT OFF
ENTRYPOINT [ "/root/go/src/github.com/cloud-barista/cb-spider/api-runtime/cb-spider" ]
EXPOSE 1024
EXPOSE 2048
EXPOSE 4096