diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 98b0e20b..3710cfe7 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -57,8 +57,6 @@ jobs: strategy: matrix: include: - - os: windows-2019 - version: 1809 - os: windows-2022 version: 2022 runs-on: ${{ matrix.os }} diff --git a/Makefile b/Makefile index 62a8a0be..fdbd4f56 100644 --- a/Makefile +++ b/Makefile @@ -155,50 +155,34 @@ set-experimental: ## Windows #################### -build-windows-1809: build-windows-packages build-nanoserver-1809 build-dotnet-framework-1809 - build-windows-2022: build-windows-packages build-dotnet-framework-2022 -build-nanoserver-1809: build-stack-nanoserver-1809 build-builder-nanoserver-1809 build-buildpacks-nanoserver-1809 - -build-dotnet-framework-1809: build-stack-dotnet-framework-1809 build-builder-dotnet-framework-1809 build-buildpacks-dotnet-framework-1809 +build-nanoserver-2022: build-stack-nanoserver-2022 build-builder-nanoserver-2022 build-buildpacks-nanoserver-2022 build-dotnet-framework-2022: build-stack-dotnet-framework-2022 build-builder-dotnet-framework-2022 build-buildpacks-dotnet-framework-2022 -build-stack-nanoserver-1809: - @echo "> Building 'nanoserver-1809' stack..." - bash stacks/build-stack.sh stacks/nanoserver-1809 - -build-stack-dotnet-framework-1809: - @echo "> Building 'dotnet-framework-1809' stack..." - bash stacks/build-stack.sh stacks/dotnet-framework-1809 +build-stack-nanoserver-2022: + @echo "> Building 'nanoserver-2022' stack..." + bash stacks/build-stack.sh stacks/nanoserver-2022 build-stack-dotnet-framework-2022: @echo "> Building 'dotnet-framework-2022' stack..." bash stacks/build-stack.sh stacks/dotnet-framework-2022 -build-builder-nanoserver-1809: build-windows-packages - @echo "> Building 'nanoserver-1809' builder..." - $(PACK_CMD) builder create cnbs/sample-builder:nanoserver-1809 --config $(SAMPLES_ROOT)/builders/nanoserver-1809/builder.toml $(PULL_POLICY_NEVER) - -build-builder-dotnet-framework-1809: build-windows-packages - @echo "> Building 'dotnet-framework-1809' builder..." - $(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-1809 --config $(SAMPLES_ROOT)/builders/dotnet-framework-1809/builder.toml $(PULL_POLICY_NEVER) +build-builder-nanoserver-2022: build-windows-packages + @echo "> Building 'nanoserver-2022' builder..." + $(PACK_CMD) builder create cnbs/sample-builder:nanoserver-2022 --config $(SAMPLES_ROOT)/builders/nanoserver-2022/builder.toml $(PULL_POLICY_NEVER) build-builder-dotnet-framework-2022: build-windows-packages @echo "> Building 'dotnet-framework-2022' builder..." $(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-2022 --config $(SAMPLES_ROOT)/builders/dotnet-framework-2022/builder.toml $(PULL_POLICY_NEVER) -build-buildpacks-nanoserver-1809: build-sample-root - @echo "> Creating 'hello-moon-windows' app using 'nanoserver-1809' builder..." - $(PACK_CMD) build sample-hello-moon-windows-app:nanoserver-1809 -v --builder cnbs/sample-builder:nanoserver-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS) - - @echo "> Creating 'hello-world-windows' app using 'nanoserver-1809' builder..." - $(PACK_CMD) build sample-hello-world-windows-app:nanoserver-1809 -v --builder cnbs/sample-builder:nanoserver-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS) +build-buildpacks-nanoserver-2022: build-sample-root + @echo "> Creating 'hello-moon-windows' app using 'nanoserver-2022' builder..." + $(PACK_CMD) build sample-hello-moon-windows-app:nanoserver-2022 -v --builder cnbs/sample-builder:nanoserver-2022 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS) -build-buildpacks-dotnet-framework-1809: build-sample-root - @echo "> Creating 'dotnet-framework' app using 'dotnet-framework-1809' builder..." - $(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-1809 -v --builder cnbs/sample-builder:dotnet-framework-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS) + @echo "> Creating 'hello-world-windows' app using 'nanoserver-2022' builder..." + $(PACK_CMD) build sample-hello-world-windows-app:nanoserver-2022 -v --builder cnbs/sample-builder:nanoserver-2022 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS) build-buildpacks-dotnet-framework-2022: build-sample-root @echo "> Creating 'dotnet-framework' app using 'dotnet-framework-2022' builder..." @@ -216,72 +200,49 @@ deploy-windows-packages: docker push cnbs/sample-package:hello-world-windows docker push cnbs/sample-package:hello-universe-windows -deploy-windows-1809: deploy-windows-stacks-1809 deploy-windows-builders-1809 - deploy-windows-2022: deploy-windows-stacks-2022 deploy-windows-builders-2022 -deploy-windows-stacks-1809: deploy-windows-stacks-nanoserver-1809 deploy-windows-stacks-dotnet-framework-1809 +deploy-windows-stacks-2022: deploy-windows-stacks-dotnet-framework-2022 deploy-windows-stacks-nanoserver-2022 -deploy-windows-stacks-2022: deploy-windows-stacks-dotnet-framework-2022 - -deploy-windows-stacks-nanoserver-1809: - @echo "> Deploying 'nanoserver-1809' stack..." - docker push cnbs/sample-stack-base:nanoserver-1809 - docker push cnbs/sample-stack-run:nanoserver-1809 - docker push cnbs/sample-stack-build:nanoserver-1809 - -deploy-windows-stacks-dotnet-framework-1809: - @echo "> Deploying 'dotnet-framework-1809' stack..." - docker push cnbs/sample-stack-run:dotnet-framework-1809 - docker push cnbs/sample-stack-build:dotnet-framework-1809 +deploy-windows-stacks-nanoserver-2022: + @echo "> Deploying 'nanoserver-2022' stack..." + docker push cnbs/sample-stack-base:nanoserver-2022 + docker push cnbs/sample-stack-run:nanoserver-2022 + docker push cnbs/sample-stack-build:nanoserver-2022 deploy-windows-stacks-dotnet-framework-2022: @echo "> Deploying 'dotnet-framework-2022' stack..." docker push cnbs/sample-stack-run:dotnet-framework-2022 docker push cnbs/sample-stack-build:dotnet-framework-2022 -deploy-windows-builders-1809: deploy-windows-builders-nanoserver-1809 deploy-windows-builders-dotnet-framework-1809 - -deploy-windows-builders-2022: deploy-windows-builders-dotnet-framework-2022 +deploy-windows-builders-2022: deploy-windows-builders-dotnet-framework-2022 deploy-windows-builders-nanoserver-2022 -deploy-windows-builders-nanoserver-1809: - @echo "> Deploying 'nanoserver-1809' builder..." - docker push cnbs/sample-builder:nanoserver-1809 - -deploy-windows-builders-dotnet-framework-1809: - @echo "> Deploying 'dotnet-framework-1809' builder..." - docker push cnbs/sample-builder:dotnet-framework-1809 +deploy-windows-builders-nanoserver-2022: + @echo "> Deploying 'nanoserver-2022' builder..." + docker push cnbs/sample-builder:nanoserver-2022 deploy-windows-builders-dotnet-framework-2022: @echo "> Deploying 'dotnet-framework-2022' builder..." docker push cnbs/sample-builder:dotnet-framework-2022 clean-windows: - @echo "> Removing 'nanoserver-1809' stack..." - docker rmi cnbs/sample-stack-base:nanoserver-1809 || true - docker rmi cnbs/sample-stack-run:nanoserver-1809 || true - docker rmi cnbs/sample-stack-build:nanoserver-1809 || true - - @echo "> Removing 'dotnet-framework-1809' stack..." - docker rmi cnbs/sample-stack-run:dotnet-framework-1809 || true - docker rmi cnbs/sample-stack-build:dotnet-framework-1809 || true + @echo "> Removing 'nanoserver-2022' stack..." + docker rmi cnbs/sample-stack-base:nanoserver-2022 || true + docker rmi cnbs/sample-stack-run:nanoserver-2022 || true + docker rmi cnbs/sample-stack-build:nanoserver-2022 || true @echo "> Removing 'dotnet-framework-2022' stack..." docker rmi cnbs/sample-stack-run:dotnet-framework-2022 || true docker rmi cnbs/sample-stack-build:dotnet-framework-2022 || true @echo "> Removing builders..." - docker rmi cnbs/sample-builder:nanoserver-1809 || true - docker rmi cnbs/sample-builder:dotnet-framework-1809 || true + docker rmi cnbs/sample-builder:nanoserver-2022 || true docker rmi cnbs/sample-builder:dotnet-framework-2022 || true - @echo "> Removing 'nanoserver-1809' apps..." - docker rmi sample-hello-moon-windows-app:nanoserver-1809 || true - docker rmi sample-hello-world-windows-app:nanoserver-1809 || true - docker rmi sample-batch-script-app:nanoserver-1809 || true - - @echo "> Removing 'dotnet-framework-1809' apps..." - docker rmi sample-aspnet-app:dotnet-framework-1809 || true + @echo "> Removing 'nanoserver-2022' apps..." + docker rmi sample-hello-moon-windows-app:nanoserver-2022 || true + docker rmi sample-hello-world-windows-app:nanoserver-2022 || true + docker rmi sample-batch-script-app:nanoserver-2022 || true @echo "> Removing 'dotnet-framework-2022' apps..." docker rmi sample-aspnet-app:dotnet-framework-2022 || true diff --git a/apps/batch-script/README.md b/apps/batch-script/README.md index 88945c0f..17e96388 100644 --- a/apps/batch-script/README.md +++ b/apps/batch-script/README.md @@ -5,7 +5,7 @@ A runnable sample app demonstrating the usage of [project descriptor](https://gi ### Usage ```bash -pack build sample-batch-script-app --builder cnbs/sample-builder:nanoserver-1809 --trust-builder +pack build sample-batch-script-app --builder cnbs/sample-builder:nanoserver-2022 --trust-builder ``` ### Extended Functionality diff --git a/apps/batch-script/batch-script-buildpack/buildpack.toml b/apps/batch-script/batch-script-buildpack/buildpack.toml index 5a6a452a..e8602327 100644 --- a/apps/batch-script/batch-script-buildpack/buildpack.toml +++ b/apps/batch-script/batch-script-buildpack/buildpack.toml @@ -9,4 +9,4 @@ name = "Batch Script Buildpack" # Stacks that the buildpack will work with [[stacks]] -id = "io.buildpacks.samples.stacks.nanoserver-1809" +id = "io.buildpacks.samples.stacks.nanoserver-2022" diff --git a/builders/dotnet-framework-1809/README.md b/builders/dotnet-framework-1809/README.md deleted file mode 100644 index b1651b5c..00000000 --- a/builders/dotnet-framework-1809/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Sample .NET Framework 1809 Builder - -### Prerequisites -* Docker with Windows Containers and support for 1809 images - -### Usage - -#### Creating the builder - -```bash -pack builder create cnbs/sample-builder:dotnet-framework-1809 --config builder.toml -``` - -#### Build app with builder - -```bash -pack build sample-app --builder cnbs/sample-builder:dotnet-framework-1809 --trust-builder --path ../../apps/aspnet -``` - -#### Run built app -``` -docker run --rm -it -p 8080:80 sample-app -``` diff --git a/builders/dotnet-framework-1809/builder.toml b/builders/dotnet-framework-1809/builder.toml deleted file mode 100644 index eac86b5b..00000000 --- a/builders/dotnet-framework-1809/builder.toml +++ /dev/null @@ -1,17 +0,0 @@ -# Buildpacks to include in builder -[[buildpacks]] -id = "samples/dotnet-framework" -version = "0.0.1" -uri = "../../buildpacks/dotnet-framework" - -# Order used for detection -[[order]] -[[order.group]] -id = "samples/dotnet-framework" -version = "0.0.1" - -# Stack that will be used by the builder -[stack] -id = "io.buildpacks.samples.stacks.dotnet-framework-1809" -run-image = "cnbs/sample-stack-run:dotnet-framework-1809" -build-image = "cnbs/sample-stack-build:dotnet-framework-1809" \ No newline at end of file diff --git a/builders/nanoserver-1809/README.md b/builders/nanoserver-1809/README.md deleted file mode 100644 index 59fcd93c..00000000 --- a/builders/nanoserver-1809/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Sample Nanoserver 1809 Builder - -### Prerequisites -* Docker with Windows Containers and support for 1809 images - -### Usage - -#### Creating the builder - -```bash -pack builder create cnbs/sample-builder:nanoserver-1809 --config builder.toml -``` - -#### Build app with builder - -```bash -pack build sample-app --builder cnbs/sample-builder:nanoserver-1809 --path ../../apps/batch-script/ --trust-builder -``` - -_After building the app you should be able to simply run it via `docker run sample-app` -and see an Buildpacks.io ASCII banner._ diff --git a/builders/nanoserver-2022/README.md b/builders/nanoserver-2022/README.md new file mode 100644 index 00000000..1cb07be8 --- /dev/null +++ b/builders/nanoserver-2022/README.md @@ -0,0 +1,21 @@ +# Sample Nanoserver 2022 Builder + +### Prerequisites +* Docker with Windows Containers and support for 2022 images + +### Usage + +#### Creating the builder + +```bash +pack builder create cnbs/sample-builder:nanoserver-2022 --config builder.toml +``` + +#### Build app with builder + +```bash +pack build sample-app --builder cnbs/sample-builder:nanoserver-2022 --path ../../apps/batch-script/ --trust-builder +``` + +_After building the app you should be able to simply run it via `docker run sample-app` +and see an Buildpacks.io ASCII banner._ diff --git a/builders/nanoserver-1809/builder.toml b/builders/nanoserver-2022/builder.toml similarity index 62% rename from builders/nanoserver-1809/builder.toml rename to builders/nanoserver-2022/builder.toml index 7cb9230a..0d276145 100644 --- a/builders/nanoserver-1809/builder.toml +++ b/builders/nanoserver-2022/builder.toml @@ -10,6 +10,6 @@ version = "0.0.1" # Stack that will be used by the builder [stack] -id = "io.buildpacks.samples.stacks.nanoserver-1809" -run-image = "cnbs/sample-stack-run:nanoserver-1809" -build-image = "cnbs/sample-stack-build:nanoserver-1809" +id = "io.buildpacks.samples.stacks.nanoserver-2022" +run-image = "cnbs/sample-stack-run:nanoserver-2022" +build-image = "cnbs/sample-stack-build:nanoserver-2022" diff --git a/buildpacks/dotnet-framework/buildpack.toml b/buildpacks/dotnet-framework/buildpack.toml index 275f967f..8a539c22 100755 --- a/buildpacks/dotnet-framework/buildpack.toml +++ b/buildpacks/dotnet-framework/buildpack.toml @@ -6,7 +6,7 @@ api = "0.9" name = "Sample .NET Framework Buildpack" [[stacks]] - id = "io.buildpacks.samples.stacks.dotnet-framework-1809" + id = "io.buildpacks.samples.stacks.dotnet-framework-2022" [[stacks]] id = "io.buildpacks.samples.stacks.dotnet-framework-2022" diff --git a/buildpacks/hello-moon-windows/buildpack.toml b/buildpacks/hello-moon-windows/buildpack.toml index 49646537..216beeb2 100644 --- a/buildpacks/hello-moon-windows/buildpack.toml +++ b/buildpacks/hello-moon-windows/buildpack.toml @@ -10,10 +10,7 @@ homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-moo # Stacks that the buildpack will work with [[stacks]] -id = "io.buildpacks.samples.stacks.nanoserver-1809" - -[[stacks]] -id = "io.buildpacks.samples.stacks.dotnet-framework-1809" +id = "io.buildpacks.samples.stacks.nanoserver-2022" [[stacks]] id = "io.buildpacks.samples.stacks.dotnet-framework-2022" diff --git a/buildpacks/hello-universe-windows/README.md b/buildpacks/hello-universe-windows/README.md index 3b1a2dd9..f409c379 100644 --- a/buildpacks/hello-universe-windows/README.md +++ b/buildpacks/hello-universe-windows/README.md @@ -6,7 +6,7 @@ A no-op meta-buildpack whose intent is to show how meta-buildpacks are construct ```bash pack build sample-hello-universe-windows-app \ - --builder cnbs/sample-builder:nanoserver-1809 \ + --builder cnbs/sample-builder:nanoserver-2022 \ --buildpack . \ --buildpack ../hello-world-windows/ \ --buildpack ../hello-moon-windows/ diff --git a/buildpacks/hello-world-windows/README.md b/buildpacks/hello-world-windows/README.md index 4d80f055..1554bbee 100644 --- a/buildpacks/hello-world-windows/README.md +++ b/buildpacks/hello-world-windows/README.md @@ -3,12 +3,12 @@ A no-op buildpack whose intent is to show minimal requirements of a buildpack on Windows. ### Prerequisites -* Docker with Windows Containers and support for 1809 images +* Docker with Windows Containers and support for 2022 images ### Usage ```bash -pack build sample-hello-world-windows-app --builder cnbs/sample-builder:nanoserver-1809 --buildpack . --trust-builder +pack build sample-hello-world-windows-app --builder cnbs/sample-builder:nanoserver-2022 --buildpack . --trust-builder ``` THEN diff --git a/buildpacks/hello-world-windows/buildpack.toml b/buildpacks/hello-world-windows/buildpack.toml index 161b9d6c..33337eab 100644 --- a/buildpacks/hello-world-windows/buildpack.toml +++ b/buildpacks/hello-world-windows/buildpack.toml @@ -9,7 +9,7 @@ name = "Hello World Buildpack" homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-world-windows" [[stacks]] -id = "io.buildpacks.samples.stacks.nanoserver-1809" +id = "io.buildpacks.samples.stacks.nanoserver-2022" [[stacks]] id = "io.buildpacks.samples.stacks.dotnet-framework-2022" diff --git a/stacks/dotnet-framework-1809/build/Dockerfile b/stacks/dotnet-framework-1809/build/Dockerfile deleted file mode 100644 index 7edd79da..00000000 --- a/stacks/dotnet-framework-1809/build/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 - -ARG stack_id - -# non-zero sets all user-owned directories to BUILTIN\Users -ARG cnb_uid=1 -ARG cnb_gid=1 - -ENV CNB_USER_ID=${cnb_uid} -ENV CNB_GROUP_ID=${cnb_gid} - -LABEL io.buildpacks.stack.id=${stack_id} -ENV CNB_STACK_ID=${stack_id} - -USER ContainerAdministrator diff --git a/stacks/dotnet-framework-1809/run/Dockerfile b/stacks/dotnet-framework-1809/run/Dockerfile deleted file mode 100644 index 90429a45..00000000 --- a/stacks/dotnet-framework-1809/run/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 - -ARG stack_id - -# Create unresolved symlink from c:\inetpub\wwwroot to c:\workspace -RUN Remove-Item -Force -Recurse c:\inetpub\wwwroot ; New-Item -Type Directory c:\workspace ; New-Item -Type SymbolicLink -Path c:\inetpub\wwwroot -Value c:\workspace ; Remove-Item -Force c:\workspace - -# launcher requires a non-empty PATH to workaround https://github.com/buildpacks/pack/issues/800 -ENV PATH=C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Users\\ContainerAdministrator\\AppData\\Local\\Microsoft\\WindowsApps - -LABEL io.buildpacks.stack.id=${stack_id} - -USER ContainerAdministrator diff --git a/stacks/nanoserver-1809/base/Dockerfile b/stacks/nanoserver-2022/base/Dockerfile similarity index 85% rename from stacks/nanoserver-1809/base/Dockerfile rename to stacks/nanoserver-2022/base/Dockerfile index 2015cd91..02eef5c1 100755 --- a/stacks/nanoserver-1809/base/Dockerfile +++ b/stacks/nanoserver-2022/base/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/windows/nanoserver:1809 +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 # non-zero sets all user-owned directories to BUILTIN\Users ARG cnb_uid=1 diff --git a/stacks/nanoserver-1809/build/Dockerfile b/stacks/nanoserver-2022/build/Dockerfile similarity index 100% rename from stacks/nanoserver-1809/build/Dockerfile rename to stacks/nanoserver-2022/build/Dockerfile diff --git a/stacks/nanoserver-1809/run/Dockerfile b/stacks/nanoserver-2022/run/Dockerfile similarity index 100% rename from stacks/nanoserver-1809/run/Dockerfile rename to stacks/nanoserver-2022/run/Dockerfile