Skip to content

Commit cb9fc20

Browse files
Update code and instructions about Docker
1 parent e47f614 commit cb9fc20

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ angular:
210210
## Development
211211

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

215215
```sh
216-
docker build -t ros2-naoqi-driver .
216+
ROS_DISTRO=iron docker compose up dev --build
217217
```
218218

219219
> To get all logs in live and build debuggable binaries,

docker-compose.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
# Docker Compose file for TurtleBot3 Behavior Examples
1+
# Docker Compose file for developer containers
22
#
33
# Usage:
44
#
5-
# To build the images:
6-
# docker compose build
7-
#
8-
# To start up a specific service by name:
9-
# docker compose up <service_name>
5+
# ROS_DISTRO=<distro> docker compose up dev --build
106
#
117
# To open an interactive shell to a running container:
12-
# docker exec -it <container_name> bash
8+
# docker exec -it naoqi_driver-dev-1 bash
139

1410
version: "3.9"
1511
services:
16-
# Developer container
1712
dev:
18-
image: ros2-naoqi-driver:dev
13+
image: naoqi-driver:dev-$ROS_DISTRO
1914
build:
2015
context: .
2116
dockerfile: docker/Dockerfile
2217
target: dev
18+
args:
19+
- ROS_DISTRO=$ROS_DISTRO
2320

2421
# Interactive shell
2522
stdin_open: true
2623
tty: true
24+
2725
# Networking and IPC for ROS 2
2826
network_mode: host
2927
ipc: host
3028
volumes:
3129
# Mount the source code
32-
- .:/ws/src/naoqi_driver2:rw
30+
- .:/ws/src/naoqi_driver:rw

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-c"]
66

77
# Create Colcon workspace with the project and its deps
88
ENV WS=/ws
9-
ENV PROJ_SRC=${WS}/src/naoqi_driver2
9+
ENV PROJ_SRC=${WS}/src/naoqi_driver
1010
COPY . $PROJ_SRC
1111
WORKDIR $WS/src
1212
RUN apt install -y git python3-vcstool

0 commit comments

Comments
 (0)