Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: move to SDK v4.0.0-dev.14 #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
8 changes: 6 additions & 2 deletions scripts/Dockerfile.alpine-base
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
# limitations under the License.
#

ARG BASE=alpine:3.8
# 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}
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 dumb-init
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 dumb-init libexecinfo-dev
# Ensure using latest versions of all installed packages to avoid any recent CVEs
RUN apk --no-cache upgrade

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)