Could you please try the below steps to resolve this issue:
- Try removing unused Docker data and resetting the environment, this clears unused images, containers, and layers that might be causing conflicts.
docker system prune -a
- Restart Docker Desktop or the Docker service (Restart-Service docker) in PowerShell.
- Ensure your host machine or build agent is running Windows Server 2022 or compatible. As per the text file you are using 2019
Replace it with
FROM mcr.microsoft.com/windows/servercore:ltsc2022
- Based on the text file you shared, you’re still copying and executing the install_vs_2019.ps1 script, even though you mentioned removing it.
- Once updated, rebuild with no cache to avoid using any corrupted intermediate layers:
docker build --no-cache -t your-image-name
- If you're using Windows containers, ensure Docker is running in Windows mode: Open Docker Desktop -> Settings -> Switch to Windows Containers.
Hope this helps!
Please Let me know if you have any queries.