1 Star 0 Fork 15

Sharlen/carina

forked from Carina/carina 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
付少松 提交于 2021-08-19 10:21 . Change the domain name
# Build the manager binary
FROM golang:1.16.6-buster AS builder
ENV GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://goproxy.cn,direct
ENV WORKSPACE=/workspace/github.com/carina-io/carina
WORKDIR $WORKSPACE
ADD . .
# Build
RUN echo Commit: `git log --pretty='%s%b%B' -n 1`
RUN cd $WORKSPACE/cmd/carina-node && go build -ldflags="-X main.gitCommitID=`git rev-parse HEAD`" -gcflags '-N -l' -o /tmp/carina-node .
RUN cd $WORKSPACE/cmd/carina-controller && go build -ldflags="-X main.gitCommitID=`git rev-parse HEAD`" -gcflags '-N -l' -o /tmp/carina-controller .
FROM registry.cn-hangzhou.aliyuncs.com/antmoveh/centos-lvm2:runtime-202104
# copy binary file
COPY --from=builder /tmp/carina-node /usr/bin/
COPY --from=builder /tmp/carina-controller /usr/bin/
COPY --from=builder /workspace/github.com/carina-io/carina/debug/config.json /etc/carina/
RUN chmod +x /usr/bin/carina-node && chmod +x /usr/bin/carina-controller
# add bcache-tools
COPY --from=builder /workspace/github.com/carina-io/carina/bcache-tools/bcache-register /usr/bin/
COPY --from=builder /workspace/github.com/carina-io/carina/bcache-tools/bcache-super-show /usr/bin/
COPY --from=builder /workspace/github.com/carina-io/carina/bcache-tools/make-bcache /usr/bin/
COPY --from=builder /workspace/github.com/carina-io/carina/bcache-tools/probe-bcache /usr/bin/
RUN chmod +x /usr/bin/bcache-register /usr/bin/bcache-register /usr/bin/bcache-register /usr/bin/bcache-register
# Update time zone to Asia-Shanghai
COPY --from=builder /workspace/github.com/carina-io/carina/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
CMD ["echo carina-node carina-controller"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/sharlen/carina.git
[email protected]:sharlen/carina.git
sharlen
carina
carina
main

搜索帮助