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

Evalg 84 #711

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion tutorials/docker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ project(connext-tutorial-docker-pub-sub)

# Include Connext CMake utilities
list(APPEND CMAKE_MODULE_PATH
"/opt/rti.com/rticonnextdds-examples/resources/cmake/Modules/"
# "/opt/rti.com/rticonnextdds-examples/resources/cmake/Modules/"
xFrenchy marked this conversation as resolved.
Show resolved Hide resolved
"/app/rticonnextdds-examples/resources/cmake/Modules/"
)
include(ConnextDdsConfigureCmakeUtils)
connextdds_configure_cmake_utils()
Expand Down
52 changes: 42 additions & 10 deletions tutorials/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,59 @@
FROM rticom/connext-sdk:7.3.0-EAR as build-stage
ARG RTI_LICENSE_AGREEMENT_ACCEPTED=false
xFrenchy marked this conversation as resolved.
Show resolved Hide resolved
xFrenchy marked this conversation as resolved.
Show resolved Hide resolved
FROM ubuntu:20.04 as build-stage

ARG RTI_LICENSE_AGREEMENT_ACCEPTED

# Install the required packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y \
build-essential \
cmake \
curl \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# Install prerequisites
RUN curl -sSL -o /usr/share/keyrings/rti-official-archive.gpg \
https://packages.rti.com/deb/official/repo.key
RUN printf -- "deb [arch=%s, signed-by=%s] %s %s main\n" \
$(dpkg --print-architecture) \
/usr/share/keyrings/rti-official-archive.gpg \
https://packages.rti.com/deb/official \
$(. /etc/os-release && echo ${VERSION_CODENAME}) | \
tee /etc/apt/sources.list.d/rti-official.list >/dev/null

# Install the RTI Connext Debian Package
RUN export DEBIAN_FRONTEND=noninteractive \
RTI_LICENSE_AGREEMENT_ACCEPTED=${RTI_LICENSE_AGREEMENT_ACCEPTED} \
&& apt-get update \
&& apt-get install -y rti-connext-dds-7.3.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists

# For armv8 uncomment the following line
# ENV CONNEXTDDS_ARCH=armv8Linux4gcc7.3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to figure out the right CONNEXTDDS_ARCH based on the system's archicteure (for ex. with uname -m)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this on armv8, this comment was leftover from how the file was before. If everything else looks good, I'll test this part in the lab to see if setting CONNEXTDDS_ARCH is needed and if so, using uname -m or some other cpu command


WORKDIR /app

# Copy the necessary files to the container
COPY rti_license.dat ${NDDSHOME}
COPY rti_license.dat /opt/rti.com/rti_connext_dds-7.3.0/
COPY CMakeLists.txt .
COPY home_automation.idl .
COPY *.cxx .
COPY *.xml .
COPY *.cxx ./
COPY *.xml ./
RUN git clone --recurse-submodule https://github.com/rticommunity/rticonnextdds-examples.git

# Build the applications
RUN mkdir build
WORKDIR /app/build
RUN cmake ..
RUN cmake .. -DCONNEXTDDS_DIR=/opt/rti.com/rti_connext_dds-7.3.0/
alexcamposruiz marked this conversation as resolved.
Show resolved Hide resolved
RUN make -j4

# Copy the built applications to a new container
FROM rticom/connext-runtime:7.3.0-EAR as final-stage
FROM ubuntu:20.04 as final-stage

WORKDIR /app
COPY --chown=rtiuser:rtigroup --from=build-stage ${NDDSHOME}/rti_license.dat ${NDDSHOME}
COPY --chown=rtiuser:rtigroup --from=build-stage /app/build/ /app
COPY *.xml /app
COPY --from=build-stage /opt/rti.com/rti_connext_dds-7.3.0/rti_license.dat ./
COPY --from=build-stage /app/build/ ./
COPY *.xml ./