-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dockerfile and docker compose files
- Loading branch information
1 parent
b3c8d6b
commit d406381
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
ARG TAG=jammy | ||
FROM ubuntu:${TAG} | ||
|
||
ARG ROS_DISTRO | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
USER root | ||
|
||
# Install | ||
RUN apt update \ | ||
&& apt upgrade -y \ | ||
&& apt install -y cmake curl git python3 | ||
|
||
# Add ROS2 sources to install ROS infrastructure tools | ||
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null | ||
|
||
# Install and configure ROS infrastructure tools | ||
RUN apt update \ | ||
&& apt install -y python3-vcstool python3-colcon-common-extensions python3-rosdep \ | ||
&& rosdep init \ | ||
&& rosdep update | ||
|
||
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image | ||
ARG WORKSPACE_DIR=/opt/industrial_calibration | ||
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/industrial_calibration \ | ||
apt update -y -qq \ | ||
&& vcs import ${WORKSPACE_DIR}/src < ${WORKSPACE_DIR}/src/industrial_calibration/dependencies.repos --shallow \ | ||
&& rosdep install \ | ||
--from-paths ${WORKSPACE_DIR}/src \ | ||
-iry | ||
|
||
# Build the repository | ||
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image | ||
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/industrial_calibration \ | ||
cd ${WORKSPACE_DIR} \ | ||
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \ | ||
&& rm -rf build log | ||
|
||
# Set the entrypoint to source the workspace | ||
COPY docker/extrinsic_calibration_gui.sh /extrinsic_calibration_gui.sh | ||
COPY docker/intrinsic_calibration_gui.sh /intrinsic_calibration_gui.sh | ||
|
||
|
||
ENTRYPOINT ["/extrinsic_calibration_gui"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
services: | ||
industrial_calibration: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile | ||
args: | ||
TAG: jammy | ||
ROS_DISTRO: humble | ||
environment: | ||
DISPLAY: $DISPLAY | ||
XAUTHORITY: $XAUTHORITY | ||
NVIDIA_DRIVER_CAPABILITIES: all | ||
ROS_LOG_DIR: /tmp | ||
container_name: industrial_calibration | ||
image: ghcr.io/ros-industrial/industrial_calibration:jammy | ||
stdin_open: true | ||
tty: true | ||
network_mode: host | ||
privileged: false | ||
user: ${CURRENT_UID} # CURRENT_UID=$(id -u):$(id -g) | ||
volumes: | ||
- /tmp/.X11-unix:/tmp/.X11-unix | ||
- /etc/hosts:/etc/hosts | ||
- /etc/passwd:/etc/passwd:ro | ||
- /etc/group:/etc/group:ro | ||
|
||
# entrypoint: /extrinsic_calibration_gui.sh | ||
entrypoint: /intrinsic_calibration_gui.sh | ||
|
||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: 1 | ||
capabilities: [gpu] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
source /opt/industrial_calibration/install/setup.bash | ||
./opt/industrial_calibration/install/industrial_calibration/bin/industrial_calibration_extrinsic_hand_eye_calibration_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
source /opt/industrial_calibration/install/setup.bash | ||
./opt/industrial_calibration/install/industrial_calibration/bin/industrial_calibration_camera_intrinsic_calibration_app |