Solution 1 :
Use something like this in your Dockerfile
escape=`
# Use the latest Windows Server Core 2019 image.
FROM mcr.microsoft.com/windows/servercore:ltsc2019 AS base
# Restore the default Windows shell for correct batch processing.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
#Install 7Zip
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
Invoke-WebRequest -UseBasicParsing https://www.7-zip.org/a/7z1805-x64.msi -OutFile 7z.msi; `
Start-Process msiexec -ArgumentList '/i 7z.msi', '/quiet', '/norestart' -NoNewWindow -Wait; `
Remove-Item -Force 7z.msi;
SHELL ["cmd", "/S", "/C"]
# Install Android SDK 28 using cmdline tools for Android
RUN curl -SL --output cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-win-8512546_latest.zip && "C:Program Files7-Zip7z.exe" e cmdline-tools.zip -o"C:Program Files (x86)Androidandroid-sdk" && cd "C:Program Files (x86)Androidandroid-sdktoolsbin" && echo y|sdkmanager "platform-tools" "platforms;android-28"
— bcch
Problem :
Trying to set up a Windows server 2019 docker image with Android SDK installed.
Most examples online are for linux. Microsoft only supports latest version https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools
How do I install a specific version?