forked from AndronixApp/termux-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-docker.ps1
More file actions
28 lines (23 loc) · 844 Bytes
/
run-docker.ps1
File metadata and controls
28 lines (23 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 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 "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
}