Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Option to take a custom Docker image #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Builds a Docker image.
image_name=dockwater
distro=$(basename $1)
image_base=${2:-ros:$distro-ros-base-jammy}

if [ $# -lt 1 ]
then
Expand All @@ -34,7 +35,7 @@ then
fi

image_plus_tag=$image_name:$(export LC_ALL=C; date +%Y_%m_%d_%H%M)
docker build --rm -t $image_plus_tag -f "${1}"/Dockerfile "${1}" && \
docker build --rm --build-arg BASE_IMG=$image_base -t $image_plus_tag -f "${1}"/Dockerfile "${1}" && \
docker tag $image_plus_tag $image_name:$distro && \
echo "Built $image_plus_tag and tagged as $image_name:$distro"
echo "To run:"
Expand Down
10 changes: 6 additions & 4 deletions humble/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ARG BASE_IMG=ros:humble-ros-base-jammy

# Ubuntu 22.04
FROM ros:humble-ros-base-jammy
FROM $BASE_IMG

# Setup timezone
ENV TZ=Etc/UTC
Expand Down Expand Up @@ -37,7 +39,7 @@ RUN apt update && \
pkg-config \
protobuf-compiler \
python3-dbg \
python3-empy \
ros:$distro-ros-base-jammy python3-empy \
python3-numpy \
python3-setuptools \
python3-pip \
Expand Down Expand Up @@ -67,8 +69,8 @@ RUN /bin/sh -c 'wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share
RUN apt update \
&& apt install -y --no-install-recommends \
gz-${GZDIST} \
ros-${ROSDIST}-desktop \
&& rm -rf /var/lib/apt/lists/* \
ros-${ROSDIST}-ros-base \
&& rm -rf /var/lib/apt/lists/* \
&& apt clean -qq

# Install some 'standard' ROS packages and utilities.
Expand Down