Skip to content

Commit

Permalink
Merge pull request #1287 from mavlink/pr-fix-docker-podman
Browse files Browse the repository at this point in the history
tools: support docker and podman
  • Loading branch information
julianoes authored Dec 10, 2020
2 parents 439347b + f0f4bdb commit b930a9b
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 b930a9b

Please sign in to comment.