-
Notifications
You must be signed in to change notification settings - Fork 70
/
Dockerfile
31 lines (24 loc) · 1.31 KB
/
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
# This is a multi-stage Dockerfile used for building minimum sized images of Device Client from your current directory.
ARG OS
ARG BASE_IMAGE
FROM ${BASE_IMAGE} AS deploy
###############################################################################
# Copy and build device client
###############################################################################
COPY . /root/aws-iot-device-client
RUN mkdir -p /root/aws-iot-device-client/build \
&& cd /root/aws-iot-device-client/build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& cmake --build . --target aws-iot-device-client
ENTRYPOINT ["/root/aws-iot-device-client/build/aws-iot-device-client"]
FROM ${OS} AS minimum_size
COPY --from=deploy /root/aws-iot-device-client/build/aws-iot-device-client ./aws-iot-device-client
COPY --from=deploy /root/aws-iot-device-client/sample-job-handlers /root/.aws-iot-device-client/jobs
COPY ./.github/docker-images/oss-compliance /root/oss-compliance
RUN HOME_DIR=/root \
&& chmod +x ${HOME_DIR}/oss-compliance/generate-oss-compliance.sh \
&& chmod +x ${HOME_DIR}/oss-compliance/test/test-oss-compliance.sh \
&& bash ${HOME_DIR}/oss-compliance/generate-oss-compliance.sh ${HOME_DIR} \
&& rm -rf ${HOME_DIR}/oss-compliance*
RUN chmod 700 /root/.aws-iot-device-client/jobs/*.sh
ENTRYPOINT ["/aws-iot-device-client"]