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

Rename Docker image and minor fix for build script #47

Merged
merged 7 commits into from
Apr 14, 2023
Merged
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
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,28 @@ At the moment, MBARI WEC is supported by source installation only. Use Ubuntu Ja
If you have an NVIDIA graphics card
```
./build.bash nvidia_opengl_ubuntu22
./build.bash buoy
./build.bash mbari_wec
```
Otherwise
```
./build.bash buoy --no-nvidia
./build.bash mbari_wec --no-nvidia
```

1. Run the container

If you have an NVIDIA graphics card
```
./run.bash buoy
./run.bash mbari_wec
```
Otherwise
```
./run.bash buoy --no-nvidia
./run.bash mbari_wec --no-nvidia
```

1. To have another window running the same docker container, run this command in a new terminal:

```
./join.bash buoy
./join.bash mbari_wec
```

### Quick start
Expand Down Expand Up @@ -188,3 +188,31 @@ This sources the compiled workspace and launches the simulation:
```
ros2 launch buoy_gazebo mbari_wec.launch.py
```

# For maintainers only: To upload to DockerHub

Make sure you have permissions to push to the
[MBARI organization on DockerHub](https://hub.docker.com/u/mbari).
This permission is given by the MBARI administrator.

Build the `mbari_wec` Docker image, as detailed above.

Find the image ID for `mbari_wec`:
```
docker images
```

Tag the image with the destination name:
```
docker tag <IMAGE ID> mbari/mbari_wec:latest
```

Push to the [`mbari/mbari_wec` public image](https://hub.docker.com/r/mbari/mbari_wec).
```
docker push mbari/mbari_wec:latest
```

You may have to log in for it to recognize your permissions:
```
docker login
```
11 changes: 7 additions & 4 deletions docker/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ while (( "$#" )); do
;;
esac
done
# set positional arguments in their proper place
# Set positional arguments in their proper place
eval set -- "$PARAMS"

if [ ! -d $DIR/$1 ]
Expand All @@ -75,6 +75,9 @@ echo "Building $image_name with base image $base"
docker build --rm -t $image_plus_tag --build-arg base=$base --build-arg user_id=$user_id $DIR/$image_name
echo "Built $image_plus_tag"

# Extra tag in case you have both the NVIDIA and no-NVIDIA images
docker tag $image_plus_tag $image_name$image_suffix:latest
echo "Tagged as $image_name$image_suffix:latest"
# Don't add extra tag if just building the NVIDIA image
if [[ "$image_name" != nvidia_opengl_ubuntu22 ]]; then
# Extra tag in case you have both the NVIDIA and no-NVIDIA images
docker tag $image_plus_tag $image_name$image_suffix:latest
echo "Tagged as $image_name$image_suffix:latest"
fi
File renamed without changes.
4 changes: 3 additions & 1 deletion docker/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ done
# set positional arguments in their proper place
eval set -- "$PARAMS"

IMG=$(basename $1)
#IMG=$(basename $1)
# Use this for image repos with a slash "/" in the name
IMG=$1

ARGS=("$@")
WORKSPACES=("${ARGS[@]:1}")
Expand Down