-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.arm64
35 lines (29 loc) · 1.19 KB
/
Dockerfile.arm64
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
FROM arm64v8/golang:1.16-alpine AS builder
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=arm64
ENV GO111MODULE=on
ENV GOPRIVATE=""
ENV GOPROXY="https://goproxy.cn,direct"
ENV GOSUMDB="sum.golang.google.cn"
WORKDIR /root/edgex-thingsboard/
# The main mirrors are giving us timeout issues on builds periodically.
# So we can try these.
RUN sed -e 's/dl-cdn[.]alpinelinux.org/mirrors.aliyun.com/g' -i~ /etc/apk/repositories
RUN apk update && apk add zeromq-dev libsodium-dev pkgconfig build-base git
ADD . .
RUN go mod download \
&& go test --cover $(go list ./... | grep -v /vendor/) \
&& go build -o main cmd/main.go
FROM arm64v8/alpine
WORKDIR /root/
ENV TZ Asia/Shanghai
# The main mirrors are giving us timeout issues on builds periodically.
# So we can try these.
RUN sed -e 's/dl-cdn[.]alpinelinux.org/mirrors.aliyun.com/g' -i~ /etc/apk/repositories
RUN apk --no-cache add zeromq
COPY --from=builder /root/edgex-thingsboard/main edgex-thingsboard
COPY --from=builder /root/edgex-thingsboard/cmd/res/docker/configuration.toml res/configuration.toml
RUN chmod +x edgex-thingsboard
ENTRYPOINT ["/root/edgex-thingsboard"]
CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry", "--confdir=/root/res"]