Skip to content

Commit 2e45bbe

Browse files
committed
fix: replace git clone with archive download in Dockerfile
The .NET Framework SDK image doesn't include git. Use Invoke-WebRequest to download source archives from GitHub instead.
1 parent e0cff1d commit 2e45bbe

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

  • cloudformation/scenarios/localgov-ims/docker

cloudformation/scenarios/localgov-ims/docker/Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref
1616

1717
WORKDIR C:\src
1818

19-
# Clone LocalGov IMS — pin to main (update to specific commit SHA for reproducibility)
20-
RUN git clone https://github.com/LocalGovIMS/localgov-ims.git . ; `
21-
git checkout main
19+
# Download LocalGov IMS source archive (no git needed in SDK image)
20+
# Pin to main branch — update URL to a specific commit SHA for reproducibility
21+
RUN Invoke-WebRequest -Uri 'https://github.com/LocalGovIMS/localgov-ims/archive/refs/heads/main.zip' -OutFile src.zip ; `
22+
Expand-Archive src.zip -DestinationPath C:\tmp ; `
23+
Copy-Item -Path 'C:\tmp\localgov-ims-main\*' -Destination C:\src -Recurse -Force ; `
24+
Remove-Item src.zip, C:\tmp -Recurse -Force
2225

2326
# Restore NuGet packages (all from nuget.org — no GitHub Packages needed)
2427
RUN nuget restore src\LocalGovIms.sln
@@ -98,9 +101,11 @@ ARG GITHUB_TOKEN
98101

99102
WORKDIR C:\src
100103

101-
# Clone GOV.UK Pay integration — pin to main (update to commit SHA for reproducibility)
102-
RUN git clone https://github.com/LocalGovIMS/localgov-ims-integration-govukpay.git . ; `
103-
git checkout main
104+
# Download GOV.UK Pay integration source archive (no git needed)
105+
RUN Invoke-WebRequest -Uri 'https://github.com/LocalGovIMS/localgov-ims-integration-govukpay/archive/refs/heads/main.zip' -OutFile src.zip ; `
106+
Expand-Archive src.zip -DestinationPath C:\tmp ; `
107+
Copy-Item -Path 'C:\tmp\localgov-ims-integration-govukpay-main\*' -Destination C:\src -Recurse -Force ; `
108+
Remove-Item src.zip, C:\tmp -Recurse -Force
104109

105110
# Add GitHub Packages NuGet source for LocalGovIMS packages
106111
RUN dotnet nuget add source "https://nuget.pkg.github.com/LocalGovIMS/index.json" `

0 commit comments

Comments
 (0)