Unverified Commit bfa60db2 authored by Stefan Scherer's avatar Stefan Scherer Committed by GitHub
Browse files

Merge pull request #127 from StefanScherer/packer-validate-in-docker

Run packer validate in Windows container
parents e046984a c67cc975
FROM mcr.microsoft.com/windows-insider:10.0.17744.1001 AS makeiso
WORKDIR C:/source
COPY . .
RUN powershell -NoProfile -ExecutionPolicy unrestricted -file make_unattend_iso.ps1
FROM mcr.microsoft.com/windowsservercore-insider:10.0.17744.1001
ENV chocolateyUseWindowsCompression false
RUN powershell -NoProfile -ExecutionPolicy unrestricted -Command \
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); \
choco feature disable --name showDownloadProgress
RUN choco install -y packer
RUN powershell -Command Install-WindowsFeature Hyper-V-PowerShell
COPY --from=makeiso C:/source C:/source
WORKDIR C:/source
RUN powershell -File test.ps1
You may wonder what's this `Dockerfile` for. I have tested the Windows Server 2019 insider 17744 build
to see if I can run the `test.ps1` script that checks all packer templates with `packer validate` in a Windows container.
docker build -t packervalidate .
If the Docker image can be built then all packer templates have no errors.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment