generated from edgexfoundry-holding/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile.alpine
52 lines (39 loc) · 1.98 KB
/
Dockerfile.alpine
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
44
45
46
47
48
49
50
51
52
# Build image for device-coap
#
# Options:
# BASE -- base image
# First, create and run a temporary image to build device-coap from C source,
# including dependents.
ARG BASE=alpine:3.18
FROM ${BASE} as builder
LABEL maintainer="Ken Bannister <[email protected]>"
RUN wget https://iotech.jfrog.io/artifactory/api/security/keypair/public/repositories/alpine-release -O /etc/apk/keys/alpine.dev.rsa.pub
RUN echo 'https://iotech.jfrog.io/artifactory/alpine-release/v3.18/main' >> /etc/apk/repositories
RUN apk add --update --no-cache build-base git gcc cmake make linux-headers yaml-dev libmicrohttpd-dev curl-dev util-linux-dev ncurses-dev iotech-paho-mqtt-c-dev-1.3 hiredis-dev libcbor-dev iotech-iot-1.5-dev
COPY scripts /device-coap/scripts
COPY src /device-coap/src/
COPY VERSION /device-coap
RUN mkdir -p /device-coap/build
WORKDIR /device-coap
RUN /device-coap/scripts/build_deps.sh 1
RUN /device-coap/scripts/build.sh
# Next, copy the binaries and headers from the build image above to the final
# runtime image.
FROM ${BASE}
RUN apk add --update --no-cache dumb-init
# Ensure using latest versions of all installed packages to avoid any recent CVEs
RUN apk --no-cache upgrade
WORKDIR /
RUN wget https://iotech.jfrog.io/artifactory/api/security/keypair/public/repositories/alpine-release -O /etc/apk/keys/alpine.dev.rsa.pub
RUN echo 'https://iotech.jfrog.io/artifactory/alpine-release/v3.18/main' >> /etc/apk/repositories
RUN apk add --update --no-cache linux-headers yaml libmicrohttpd curl libuuid iotech-paho-mqtt-c-dev-1.3 hiredis libcbor iotech-iot-1.5
COPY --from=builder /device-coap/build/release/device-coap /
COPY --from=builder /usr/local/lib/libcoap-2.so /usr/local/lib/
COPY --from=builder /usr/local/include/coap2 /usr/local/include/coap2
COPY --from=builder /usr/local/lib/libtinydtls.so /usr/local/lib/
COPY --from=builder /usr/lib/libcsdk.so /usr/lib
COPY LICENSE /
COPY Attribution.txt /
COPY res /res
ENTRYPOINT ["/device-coap"]
CMD ["-cp=consul.http://edgex-core-consul:8500", "--registry"]