-
-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1287 from mavlink/pr-fix-docker-podman
tools: support docker and podman
- Loading branch information
Showing
1 changed file
with
14 additions
and
2 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 |
---|---|---|
@@ -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 |