0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-11-13 14:09:19 +00:00
termux-packages/scripts/run-docker.ps1
Leonid Pliushch dc3869ad37
enhance(scripts): use GitHub package registry for Docker image
Should provide better (maybe) download speed when using GitHub Actions.
2022-07-23 00:19:08 +03:00

29 lines
824 B
PowerShell

# PowerShell script to build Termux packages with Docker.
#
# Usage example:
#
# .\scripts\run-docker.ps1 ./build-package.sh -a arm libandroid-support
Set-Variable -Name IMAGE_NAME -Value "ghcr.io/termux/package-builder"
Set-Variable -Name CONTAINER_NAME -Value "termux-package-builder"
Write-Output "Running container ${CONTAINER_NAME} from image ${IMAGE_NAME}..."
docker start $CONTAINER_NAME 2>&1 | Out-Null
if (-Not $?) {
Write-Output "Creating new container..."
docker run `
--detach `
--name $CONTAINER_NAME `
--volume "${PWD}:/home/builder/termux-packages" `
--tty `
"$IMAGE_NAME"
}
if ($args.Count -eq 0) {
docker exec --interactive --tty --user builder $CONTAINER_NAME bash
} else {
docker exec --interactive --tty --user builder $CONTAINER_NAME $args
}