-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_dockerfile
43 lines (30 loc) · 1.23 KB
/
sample_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
#build stage
ARG BASE=golang:1.18-alpine3.16
FROM ${BASE} AS builder
ARG ALPINE_PKG_BASE="make git gcc libc-dev libsodium-dev zeromq-dev"
ARG ALPINE_PKG_EXTRA=""
LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2022: Intel'
RUN sed -e 's/dl-cdn[.]alpinelinux.org/dl-4.alpinelinux.org/g' -i~ /etc/apk/repositories
RUN apk add --update --no-cache ${ALPINE_PKG_BASE} ${ALPINE_PKG_EXTRA}
WORKDIR /cloud-export-mqtt
COPY go.mod vendor* ./
RUN [ ! -d "vendor" ] && go mod download all || echo "skipping..."
COPY . .
ARG MAKE="make build"
RUN $MAKE
# Docker Client
FROM alpine:3.16
# REST Communications
RUN apk add --update --no-cache ca-certificates zeromq dumb-init curl libc6-compat
RUN apk add --no-cache tzdata
ENV TZ=Asia/Ho_Chi_Minh
# Copy files
COPY --from=builder /cloud-export-mqtt/Attribution.txt /Attribution.txt
COPY --from=builder /cloud-export-mqtt/LICENSE /LICENSE
COPY --from=builder /cloud-export-mqtt/cloud-export-mqtt /cloud-export-mqtt
# COPY --from=builder /cloud-export-mqtt/list_of_device.json /list_of_device.json
COPY --from=builder /cloud-export-mqtt/res/ /res/
EXPOSE 59712
ENTRYPOINT ["/cloud-export-mqtt"]
CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry", "--confdir=/res"]