5 Star 26 Fork 154

禹霖科技开源/driver-box

forked from iBUILDING-X/driver-box 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
花木水之间 提交于 2023-07-05 20:21 . add 测试 docker-compose
FROM golang:1.18-alpine AS builder
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /build
COPY ./config ./config
COPY ./core ./core
COPY ./driver ./driver
COPY ./driver-config ./driver-config
COPY ./res ./res
COPY ./go.sum ./go.sum
COPY ./go.mod ./go.mod
COPY ./main.go ./main.go
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk update && apk add pkgconfig zeromq-dev gcc libc-dev && \
go mod vendor && \
go build -o driver-box .
FROM alpine:latest
WORKDIR /
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk update && apk add zeromq-dev curl tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata && \
rm -rf /var/cache/apk/*
COPY --from=builder /build/driver-config /driver-config
COPY --from=builder /build/res /res
COPY --from=builder /build/driver-box /driver-box
EXPOSE 59999
ENTRYPOINT ["/driver-box"]
CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry", "--confdir=/res"]
#CMD ["-cp=consul.http://0.0.0.0:8500", "--registry", "--confdir=/res"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/open-iita/driver-box.git
[email protected]:open-iita/driver-box.git
open-iita
driver-box
driver-box
master

搜索帮助