0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-11-13 14:09:19 +00:00
termux-packages/scripts/update-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

22 lines
731 B
PowerShell

# PowerShell script to update Termux Package Builder Docker Image
#
# Usage example:
#
# .\scripts\update-docker.ps1
Set-Variable -Name CONTAINER -Value "termux-package-builder"
Set-Variable -Name IMAGE -Value "ghcr.io/termux/package-builder"
docker pull $IMAGE
Set-Variable -Name LATEST -Value (docker inspect --format "{{.Id}}" $IMAGE)
Set-Variable -Name RUNNING -Value (docker inspect --format "{{.Image}}" $CONTAINER)
if ($LATEST -eq $RUNNING) {
Write-Output "Image '$IMAGE' used in the container '$CONTAINER' is already up to date"
} else {
Write-Output "Image '$IMAGE' used in the container '$CONTAINER' has been updated - removing the outdated container"
docker stop $CONTAINER
docker rm -f $CONTAINER
}