-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ARG TAG | ||
FROM ubuntu:${TAG} | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
USER root | ||
|
||
# Install | ||
RUN apt update \ | ||
&& apt install -y \ | ||
curl \ | ||
lsb-release \ | ||
git \ | ||
build-essential | ||
|
||
# Install ROS sources and tooling dependencies | ||
COPY .github/workflows/add_ros_apt_sources.sh /tmp/add_ros_apt_sources.sh | ||
RUN ./tmp/add_ros_apt_sources.sh \ | ||
&& apt install -y \ | ||
python3-colcon-common-extensions \ | ||
python3-rosdep \ | ||
python3-vcstool \ | ||
liboctomap-dev \ | ||
&& rosdep init \ | ||
&& rosdep update | ||
|
||
# Install the dependency repositories | ||
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image | ||
ARG WORKSPACE_DIR=/opt/tesseract | ||
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract \ | ||
cd ${WORKSPACE_DIR} \ | ||
&& vcs import src < src/tesseract/dependencies.repos --shallow \ | ||
&& rosdep install \ | ||
--from-paths ${WORKSPACE_DIR}/src \ | ||
-iry | ||
|
||
# Build the repository | ||
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image | ||
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract \ | ||
cd ${WORKSPACE_DIR} \ | ||
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \ | ||
&& rm -rf build log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Tesseract Docker | ||
|
||
## Create the Docker image | ||
### Download | ||
Download a pre-built Docker image for this bridge from the container registry: | ||
|
||
``` | ||
docker login ghcr.io | ||
docker pull ghcr.io/tesseract-robotics/tesseract_deploy:<tag> | ||
``` | ||
|
||
### Build | ||
Build the Docker image using `docker-compose`: | ||
|
||
```commandLine | ||
cd docker | ||
docker compose build | ||
``` | ||
|
||
## Run the docker image | ||
Run the Docker image using `docker-compose`: | ||
|
||
```commandLine | ||
cd docker | ||
CURRENT_UID=$(id -u):$(id -g) docker compose up | ||
``` | ||
|
||
> Note: by default the docker image runs as a non-root user, so the environment variable `CURRENT_UID` must be supplied as shown above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3' | ||
services: | ||
tesseract: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile | ||
args: | ||
- TAG=focal | ||
container_name: tesseract | ||
image: ghcr.io/tesseract-robotics/tesseract_deploy:focal-0.20 | ||
stdin_open: true | ||
tty: true | ||
network_mode: host | ||
user: ${CURRENT_UID} # CURRENT_UID=$(id -u):$(id -g) |