From 0d6cc73d9f927a334243838f3d04cd89b3781ee2 Mon Sep 17 00:00:00 2001 From: Amitie10g Date: Mon, 2 Oct 2023 03:08:18 +0000 Subject: [PATCH] Ditch history --- .github/workflows/docker-image.yml | 51 ++++++++++++++++++++++++++++++ Dockerfile | 9 ++++++ LICENSE | 24 ++++++++++++++ README.md | 21 ++++++++++++ build.ps1 | 34 ++++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 .github/workflows/docker-image.yml create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.ps1 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..326b41e --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,51 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + schedule: + - cron: "0 1 * * 0" + +jobs: + ltsc2022: + strategy: + matrix: + VS_VER: ["2022", "2019", "2017"] + runs-on: windows-2022 + env: + WIN_VER: ltsc2022 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}-workload-vctools -t ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}-workload-vctools:${{ env.WIN_VER }} --build-arg WIN_VER=${{ env.WIN_VER }} --build-arg VS_VER=${{ matrix.VS_VER }} . + - name: push + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}-workload-vctools --all-tags + + ltsc2019: + strategy: + matrix: + VS_VER: ["2022", "2019", "2017"] + runs-on: windows-2019 + env: + WIN_VER: ltsc2019 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}-workload-vctools:${{ env.WIN_VER }} --build-arg WIN_VER=${{ env.WIN_VER }} --build-arg VS_VER=${{ matrix.VS_VER }} . + - name: push + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/visualstudio${{ matrix.VS_VER }}-workload-vctools --all-tags diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..17c00f0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +ARG WIN_VER=ltsc2022 + +ARG VS_VER=2022 + +FROM amitie10g/visualstudio${VS_VER}buildtools:${WIN_VER} +ARG VS_VER + +SHELL ["powershell", "-Command"] +RUN choco install -y visualstudio${env:VS_VER}-workload-vctools; choco-cleaner diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/README.md b/README.md new file mode 100644 index 0000000..76b0ec0 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Visual C++ build tools workload for Visual Studio Build Tools +This container brings Visual C++ build tools workload for Visual Studio Build Tools (2022, 2019 and 2017) in a Docker container using the [.NET Framework runtime](https://hub.docker.com/_/microsoft-dotnet-framework-runtime/) 4.8 (on Windows Server Core ltsc2022 and ltsc2019) base image, plus [Chocolatey](https://chocolatey.org/). + +# Container images available at Docker Hub +* [``amitie10g/visualstudio2022-workload-vctools``](https://hub.docker.com/r/amitie10g/visualstudio2022-workload-vctools) +* [``amitie10g/visualstudio2019-workload-vctools``](https://hub.docker.com/r/amitie10g/visualstudio2019-workload-vctools) +* [``amitie10g/visualstudio2019-workload-vctools``](https://hub.docker.com/r/amitie10g/visualstudio2017-workload-vctools) + +## Tags: +* ``ltsc2022`` ``latest`` +* ``ltsc2019`` + +# Building +* GitHub Actions workflow is provided for automated builds onto Server Core 2022 and 2019. +* ``build.ps1`` Powershell script is provided for building different versions as your needs. + +# Licensing +* The contents on this repo are released into the Public domain (**The Unlicense**) +* Chocolatey is licensed under the **[Apache License](https://github.com/chocolatey/choco/blob/master/LICENSE)** +* Micriosoft Windows Container images usage is subjected to the **[Microsoft EULA](https://learn.microsoft.com/virtualization/windowscontainers/images-eula)** +* Visual Studio Build Tools usage is subjected to the **[Microsoft EULA](https://visualstudio.microsoft.com/license-terms/vs2022-ga-diagnosticbuildtools/)** diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..9541eb3 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,34 @@ +#escape=` +$DockerUser="amitie10g" + +# Visual Studio version +$VisualStudioVersions = @( + "2022", + "2019", + "2017" +) + +# Windows version +$WindowsVersions = @( + "ltsc2022", + "ltsc2019" +) + +# Build each version available +foreach (${VSVer} in ${VisualStudioVersions}) { + docker build ` + -t ${DockerUser}/visualstudio${VSVer}-workload-vctools ` + --build-arg VS_VER=${VSVer} ` + --isolation=hyperv ` + . + foreach (${WinVer} in ${WindowsVersions}) { + docker build ` + -t ${DockerUser}/visualstudio${VSVer}-workload-vctools:${WinVer} ` + --build-arg WIN_VER=${WinVer} ` + --build-arg VS_VER=${VSVer} ` + --isolation=hyperv ` + . + } + + docker push ${DockerUser}/visualstudio${VSVer}-workload-vctools --all-tags +}