Skip to content

Commit

Permalink
tools: support docker and podman
Browse files Browse the repository at this point in the history
This was accidentally changed to podman beforehand. I'm now changing it
back to docker but also supporting podman if available.
  • Loading branch information
julianoes committed Dec 10, 2020
1 parent e9251d5 commit f0f4bdb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/run-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/usr/bin/env sh

podman run -it --rm -v $(pwd):/home/user/MAVSDK:z mavsdk/mavsdk-ubuntu-20.04-px4-sitl-v1.11 "$@"
sudo chown -R $USER:$USER .
if command -v podman &> /dev/null
then
podman run -it --rm -v $(pwd):/home/user/MAVSDK:z mavsdk/mavsdk-ubuntu-20.04-px4-sitl-v1.11 "$@"
echo "sudo needed to repair file ownership after podman ran: sudo chown -R $USER:$USER ."
sudo chown -R $USER:$USER .

elif command -v docker &> /dev/null
then
docker run -it --rm -v $(pwd):/home/user/MAVSDK:z -e LOCAL_USER_ID=`id -u` mavsdk/mavsdk-ubuntu-18.04-px4-sitl "$@"

else
echo "docker or podman commands not found"
exit 1
fi

0 comments on commit f0f4bdb

Please sign in to comment.