forked from oceanbase/ob-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (30 loc) · 1.24 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
# build builder
FROM golang:1.16 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY . .
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://mirrors.aliyun.com/goproxy/ go build -a -o cable cmd/cable/app.go
# build server
FROM openanolis/anolisos:8.4-x86_64
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
WORKDIR /app
COPY --from=builder /workspace/cable .
RUN chmod +x /app/cable
RUN useradd -m admin
ENV OB_VERSION 3.1.2-10000392021123010
RUN rpm -ivh https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/oceanbase-ce-libs-${OB_VERSION}.el8.x86_64.rpm
RUN rpm -ivh https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/oceanbase-ce-${OB_VERSION}.el8.x86_64.rpm
RUN mkdir -p /home/admin/oceanbase/run
RUN mkdir -p /home/admin/oceanbase/store/sort_dir
RUN mkdir -p /home/admin/oceanbase/store/sstable
RUN mkdir -p /home/admin/oceanbase/store/clog
RUN mkdir -p /home/admin/oceanbase/store/ilog
RUN mkdir -p /home/admin/oceanbase/store/slog
RUN mkdir -p /home/admin/oceanbase/log
RUN chown -R admin:admin /home/admin/oceanbase/
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
CMD ["/app/cable"]