Skip to content

Commit

Permalink
build: move to SDK v4.0.0-dev.14
Browse files Browse the repository at this point in the history
Signed-off-by: FelixTing <[email protected]>
  • Loading branch information
FelixTing committed Jan 14, 2025
1 parent d651ea3 commit 8d26c40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
16 changes: 10 additions & 6 deletions scripts/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
# limitations under the License.
#

ARG BASE=alpine:3.18
# Use alpine:3.16 as the base image because starting from alpine:3.17, the execinfo library has been removed.
# The execinfo library is required by the current implementation of the handle_sig function in device-can.c.
# If switching to a newer alpine version, modifications to the handle_sig function will be necessary
# to eliminate the dependency on execinfo (e.g., by replacing it with libunwind or similar).
ARG BASE=alpine:3.16
FROM ${BASE} as builder
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.16/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 paho-mqtt-c-dev-1.3 hiredis-dev libcbor-dev iotech-iot-1.5-dev
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 libexecinfo-dev

COPY scripts /device-can/scripts
COPY src /device-can/src/
Expand All @@ -28,14 +32,14 @@ WORKDIR /device-can

RUN /device-can/scripts/build_deps.sh 1

RUN /device-can/scripts/build.sh
RUN /device-can/scripts/build.sh && test -f /device-can/build/release/device-can

FROM alpine:3.18
FROM alpine:3.16
MAINTAINER hcltech <www.hcltech.com/engineering-services>
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.16/main' >> /etc/apk/repositories

RUN apk add --update --no-cache linux-headers yaml libmicrohttpd curl libuuid paho-mqtt-c-dev-1.3 hiredis libcbor iotech-iot-1.5 dumb-init
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 dumb-init libexecinfo
# Ensure using latest versions of all installed packages to avoid any recent CVEs
RUN apk --no-cache upgrade

Expand All @@ -52,4 +56,4 @@ LABEL license='SPDX-License-Identifier: Apache-2.0' \

EXPOSE 59980
ENTRYPOINT ["/device-can"]
CMD ["-cp=consul://edgex-core-consul:8500", "--registry", "--confdir=/res"]
CMD ["-cp=keeper://edgex-core-keeper:59890", "--registry", "--confdir=/res"]
4 changes: 2 additions & 2 deletions scripts/Dockerfile.alpine-base
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# limitations under the License.
#

ARG BASE=alpine:3.8
ARG BASE=alpine:3.20
FROM ${BASE}
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.16/main' >> /etc/apk/repositories
RUN echo 'https://iotech.jfrog.io/artifactory/alpine-release/v3.20/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 paho-mqtt-c-dev-1.3 hiredis-dev libcbor-dev iotech-iot-1.5-dev dumb-init
# Ensure using latest versions of all installed packages to avoid any recent CVEs
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -e -x

BUILD_CSDK=$1

CSDK_VERSION=3.0.2
CSDK_VERSION=4.0.0-dev.14

if [ -d deps ]
then
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ file (GLOB C_FILES c/*.c)
find_library(EDGEX_CSDK_RELEASE_LIB NAMES csdk)
#find_library(IOT_LIBRARIES NAMES iot)
find_library (IOT_LIBRARY iot PATHS /opt/iotech/iot/${IOT_VER}/lib)
find_library(EXECINFO_LIBRARY NAMES execinfo)
add_executable(device-can ${C_FILES})
target_compile_definitions(device-can PRIVATE VERSION="${CAN_DOT_VERSION}")
target_include_directories (device-can PRIVATE .)
target_include_directories (device-can PRIVATE ${IOT_INCLUDE_DIRS})
target_link_libraries (device-can PUBLIC m PRIVATE ${EDGEX_CSDK_RELEASE_LIB})
target_link_libraries (device-can PUBLIC m PRIVATE ${IOT_LIBRARY})
target_link_libraries (device-can PRIVATE ${EXECINFO_LIBRARY})
install(TARGETS device-can DESTINATION bin)

0 comments on commit 8d26c40

Please sign in to comment.