Skip to content

Commit

Permalink
docs(docker): describe multi-stage Dockerfile structure (#5093)
Browse files Browse the repository at this point in the history
* add svg

Signed-off-by: Yutaka Kondo <[email protected]>

* wip

Signed-off-by: Yutaka Kondo <[email protected]>

* style(pre-commit): autofix

* add devel and runtime

Signed-off-by: Yutaka Kondo <[email protected]>

* refine

Signed-off-by: Yutaka Kondo <[email protected]>

---------

Signed-off-by: Yutaka Kondo <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
youtalk and pre-commit-ci[bot] authored Aug 14, 2024
1 parent 2f9cbfb commit 18e73a1
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,43 @@
[Open AD Kit](https://autoware.org/open-ad-kit/) offers containers for Autoware to simplify the development and deployment of Autoware and its dependencies. This directory contains scripts to build and run the containers.

Detailed instructions on how to use the containers can be found in the [Open AD Kit documentation](https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/docker-installation/).

## Multi-stage Dockerfile structure

![](./img/Dockerfile.svg)

### `$BASE_IMAGE`

This is a base image of this Dockerfile. [`ros:humble-ros-base-jammy`](https://hub.docker.com/_/ros/tags?page=&page_size=&ordering=&name=humble-ros-base-jammy) will be given.

### `base`

This stage performs only the basic setup required for all Autoware images.

### `rosdep-depend`

The following three ROS dependency package list files will be generated:

- `/rosdep-core-depend-packages.txt`: A dependency package list file for the packages under the `core` directory of `autoware.repos`.
- `/rosdep-universe-depend-packages.txt`: A dependency package list file for the packages under the `universe` directory of `autoware.repos`.
- `/rosdep-exec-depend-packages.txt`: A dependency package list file required for running Autoware.

These files will be used in the subsequent `autoware-core`, `autoware-universe`, and `runtime` stages.

By generating only the package list files and copying them to the subsequent stages, the dependency packages will not be reinstalled during the container build process unless the dependency packages change.

### `autoware-core`

This stage installs the dependency packages based on `/rosdep-core-depend-packages.txt` and build the packages under the `core` directory of `autoware.repos`.

### `autoware-universe`

This stage installs the dependency packages based on `/rosdep-universe-depend-packages.txt` and build the packages under the `universe` directory of `autoware.repos`.

### `devel`

This stage provides a [development container](https://containers.dev) to Autoware developers. By running the host's source code with volume mounting, it allows for easy building and debugging of Autoware.

### `runtime`

This stage is an Autoware runtime container. It only includes the dependencies given by `/rosdep-exec-depend-packages.txt`, the binaries built in the `autoware-universe` stage, and artifacts.
163 changes: 163 additions & 0 deletions docker/img/Dockerfile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 18e73a1

Please sign in to comment.