Skip to content

Latest commit

 

History

History
146 lines (108 loc) · 4.46 KB

README.md

File metadata and controls

146 lines (108 loc) · 4.46 KB

Docker images for Autoware

We have two types of Docker image: development and prebuilt.

  1. The development image enables you to develop Autoware without setting up the local development environment.
  2. The prebuilt image contains executables and enables you to try out Autoware quickly.
    • Note that the prebuilt image is not designed for deployment on a real vehicle!

Note: Before pulling these images, confirm and agree with the NVIDIA Deep Learning Container license.

Prerequisites

  • Docker
  • rocker
    • We use rocker to enable GUI applications such as rviz and rqt on Docker Containers.
    • Refer to here for more details.

The setup script will install these dependencies through the docker role.

Usage

Development image

docker run --rm -it \
  -v {path_to_your_workspace}:/autoware \
  ghcr.io/autowarefoundation/autoware-universe:latest

To run with rocker:

rocker --nvidia --x11 --user \
 --volume {path_to_your_workspace} \
 -- ghcr.io/autowarefoundation/autoware-universe:latest

If you locate your workspace under your home directory, you can use the --home option instead:

rocker --nvidia --x11 --user --home \
  -- ghcr.io/autowarefoundation/autoware-universe:latest

To use a customized .bashrc for the container:

rocker --nvidia --x11 --user --home \
  --volume $HOME/.bashrc.container:$HOME/.bashrc \
  -- ghcr.io/autowarefoundation/autoware-universe:latest

Prebuilt image

docker run --rm -it \
  ghcr.io/autowarefoundation/autoware-universe:latest-prebuilt

To run with rocker:

rocker --nvidia --x11 --user \
  --volume {path_to_your_workspace} \
  -- ghcr.io/autowarefoundation/autoware-universe:latest-prebuilt

If you intend to use pre-existing data such as maps or Rosbags, modify the --volume options shown below.

rocker --nvidia --x11 --user \
  --volume {path_to_your_workspace} \
  --volume {path_to_your_map_data} \
  --volume {path_to_your_log_data} \
  -- ghcr.io/autowarefoundation/autoware-universe:latest-prebuilt

Building Docker images on your local machine

If you want to build these images locally for development purposes, run the following command:

cd autoware/
./docker/build.sh

Tips

Precautions for not using rocker

If either image is run without rocker, then root privileges will be used. This can affect your local environment as below:

$ docker run --rm -it -v {path_to_your_workspace}:/autoware ghcr.io/autowarefoundation/autoware-universe:latest
# colcon build
# exit
$ rm build/COLCON_IGNORE
rm: remove write-protected regular empty file 'build/COLCON_IGNORE'? y
rm: cannot remove 'build/COLCON_IGNORE': Permission denied

To prevent this error occurring when rocker is not used, there are two suggested methods:

  1. Prepare a dedicated workspace for the docker image.

  2. Use Visual Studio Code's Remote - Containers extension.

    To use the extension, the following settings can be used to create a user account in a similar way to `rocker.
    Refer to this document for more details.

    // .devcontainer/devcontainer.json
    {
      "name": "Autoware",
      "build": {
        "dockerfile": "Dockerfile"
      },
      "remoteUser": "autoware",
      "settings": {
        "terminal.integrated.defaultProfile.linux": "bash"
      }
    }
    # .devcontainer/Dockerfile
    FROM ghcr.io/autowarefoundation/autoware-universe:latest
    
    ARG USERNAME=autoware
    ARG USER_UID=1000
    ARG USER_GID=$USER_UID
    
    RUN groupadd --gid $USER_GID $USERNAME \
      && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
      && apt-get update \
      && apt-get install -y sudo \
      && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
      && chmod 0440 /etc/sudoers.d/$USERNAME
    

Using Docker images other than latest

There are also images versioned based on the date or release tag.
Use them when you need a fixed version of the image.

The list of versions can be found here.