Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions images.CI/linux-and-win/build-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Write-Host "Download packer plugins"
packer plugins install github.com/hashicorp/azure $pluginVersion

Write-Host "Validate packer template"
packer validate -syntax-only -only "$buildName*" $TemplatePath
packer validate -syntax-only -only "$buildName.*" $TemplatePath

Write-Host "Build $buildName VM"
packer build -only "$buildName*" `
packer build -only "$buildName.*" `
-var "client_id=$ClientId" `
-var "client_secret=$ClientSecret" `
-var "install_password=$InstallPassword" `
Expand Down
15 changes: 15 additions & 0 deletions images/ubuntu/scripts/build/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,25 @@ done
# Install plugins that are best installed from the GitHub repository
# Be aware that `url` built from github repo name and plugin name because of current repo naming for those plugins

case "$docker_arch" in
amd64) arch_pattern="amd64|x86_64" ;;
arm64) arch_pattern="arm64|aarch64" ;;
esac

plugins=$(get_toolset_value '.docker.plugins[] .plugin')
for plugin in $plugins; do
version=$(get_toolset_value ".docker.plugins[] | select(.plugin == \"$plugin\") | .version")
filter=$(get_toolset_value ".docker.plugins[] | select(.plugin == \"$plugin\") | .asset")

# Toolset asset filters are architecture-specific strings (e.g. "linux-arm64"), unlike the
# engine arch above, which is machine-detected. Fail fast instead of silently installing a
# plugin binary that doesn't match the host, which fails at runtime with "exec format error".
if ! [[ "$filter" =~ ($arch_pattern) ]]; then
echo "Error: host architecture is '$docker_arch' but toolset plugin '$plugin' targets asset '$filter'." >&2
echo "This build definition/toolset combination doesn't match the host it's running on." >&2
exit 1
fi

url=$(resolve_github_release_asset_url "docker/$plugin" "endswith(\"$filter\")" "$version")
binary_path=$(download_with_retry "$url" "/tmp/docker-$plugin")
mkdir -pv "/usr/libexec/docker/cli-plugins"
Expand Down
Loading