diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cdb866f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ros:melodic + +RUN apt-get update && apt-get install -y \ + curl \ + x11-apps \ + x11-utils \ + x11-xserver-utils \ + xserver-xephyr \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y + +ENV PATH="/root/.cargo/bin:${PATH}" + +RUN git clone https://github.com/openrr/urdf-viz.git /urdf-viz + +WORKDIR /urdf-viz + +RUN cargo install urdf-viz diff --git a/README.md b/README.md index 7de03b3..71ca022 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,15 @@ You can install urdf-viz using [Homebrew tap on macOS and Linux](https://github. ```sh brew install openrr/tap/urdf-viz ``` +### Run with Docker +Build docker image: +```bash +docker build . -t urdf_viz_docker +``` +Create container: +```bash +docker run -it --rm --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $XAUTHORITY:/tmp/.docker.xauth -e XAUTHORITY=/tmp/.docker.xauth urdf_viz_docker +``` ## How to use