Skip to content

Commit

Permalink
Update code and instructions about Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpaleologue committed Dec 5, 2023
1 parent e47f614 commit cb9fc20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ angular:
## Development

Check how to [install the driver from source](#installing-from-source),
or use the [`Dockerfile`](Dockerfile) to get setup a reproducible dev environment:
or use `docker compose` to get a more reproducible dev environment:

```sh
docker build -t ros2-naoqi-driver .
ROS_DISTRO=iron docker compose up dev --build
```

> To get all logs in live and build debuggable binaries,
Expand Down
18 changes: 8 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
# Docker Compose file for TurtleBot3 Behavior Examples
# Docker Compose file for developer containers
#
# Usage:
#
# To build the images:
# docker compose build
#
# To start up a specific service by name:
# docker compose up <service_name>
# ROS_DISTRO=<distro> docker compose up dev --build
#
# To open an interactive shell to a running container:
# docker exec -it <container_name> bash
# docker exec -it naoqi_driver-dev-1 bash

version: "3.9"
services:
# Developer container
dev:
image: ros2-naoqi-driver:dev
image: naoqi-driver:dev-$ROS_DISTRO
build:
context: .
dockerfile: docker/Dockerfile
target: dev
args:
- ROS_DISTRO=$ROS_DISTRO

# Interactive shell
stdin_open: true
tty: true

# Networking and IPC for ROS 2
network_mode: host
ipc: host
volumes:
# Mount the source code
- .:/ws/src/naoqi_driver2:rw
- .:/ws/src/naoqi_driver:rw
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-c"]

# Create Colcon workspace with the project and its deps
ENV WS=/ws
ENV PROJ_SRC=${WS}/src/naoqi_driver2
ENV PROJ_SRC=${WS}/src/naoqi_driver
COPY . $PROJ_SRC
WORKDIR $WS/src
RUN apt install -y git python3-vcstool
Expand Down

0 comments on commit cb9fc20

Please sign in to comment.