From 242a52d7ab33b775e490285677e780cc4b9281a7 Mon Sep 17 00:00:00 2001 From: Aidan Delaney Date: Mon, 10 Feb 2025 07:53:21 +0000 Subject: [PATCH 1/2] Remove WCOW examples Remove any examples of Windows Containers on Windows. Signed-off-by: Aidan Delaney --- Makefile | 105 +----------------- .../dotnet-framework-2022/base/Dockerfile | 11 -- .../dotnet-framework-2022/build/Dockerfile | 16 --- .../dotnet-framework-2022/run/Dockerfile | 15 --- base-images/nanoserver-2022/base/Dockerfile | 14 --- base-images/nanoserver-2022/build/Dockerfile | 16 --- base-images/nanoserver-2022/run/Dockerfile | 5 - builders/dotnet-framework-2022/README.md | 23 ---- builders/dotnet-framework-2022/builder.toml | 24 ---- builders/nanoserver-2022/README.md | 21 ---- builders/nanoserver-2022/builder.toml | 22 ---- buildpacks/dotnet-framework/bin/build.bat | 45 -------- buildpacks/dotnet-framework/bin/detect.bat | 16 --- buildpacks/dotnet-framework/buildpack.toml | 18 --- buildpacks/dotnet-framework/package.toml | 2 - buildpacks/hello-moon-windows/README.md | 9 -- buildpacks/hello-moon-windows/bin/build.bat | 33 ------ buildpacks/hello-moon-windows/bin/detect.bat | 16 --- buildpacks/hello-moon-windows/buildpack.toml | 20 ---- buildpacks/hello-universe-windows/README.md | 13 --- .../hello-universe-windows/buildpack.toml | 19 ---- .../hello-universe-windows/package.toml | 13 --- buildpacks/hello-world-windows/README.md | 18 --- buildpacks/hello-world-windows/bin/build.bat | 39 ------- buildpacks/hello-world-windows/bin/detect.bat | 15 --- buildpacks/hello-world-windows/buildpack.toml | 22 ---- buildpacks/hello-world-windows/package.toml | 5 - 27 files changed, 1 insertion(+), 574 deletions(-) delete mode 100644 base-images/dotnet-framework-2022/base/Dockerfile delete mode 100644 base-images/dotnet-framework-2022/build/Dockerfile delete mode 100644 base-images/dotnet-framework-2022/run/Dockerfile delete mode 100755 base-images/nanoserver-2022/base/Dockerfile delete mode 100755 base-images/nanoserver-2022/build/Dockerfile delete mode 100755 base-images/nanoserver-2022/run/Dockerfile delete mode 100644 builders/dotnet-framework-2022/README.md delete mode 100644 builders/dotnet-framework-2022/builder.toml delete mode 100644 builders/nanoserver-2022/README.md delete mode 100644 builders/nanoserver-2022/builder.toml delete mode 100644 buildpacks/dotnet-framework/bin/build.bat delete mode 100644 buildpacks/dotnet-framework/bin/detect.bat delete mode 100755 buildpacks/dotnet-framework/buildpack.toml delete mode 100755 buildpacks/dotnet-framework/package.toml delete mode 100644 buildpacks/hello-moon-windows/README.md delete mode 100644 buildpacks/hello-moon-windows/bin/build.bat delete mode 100644 buildpacks/hello-moon-windows/bin/detect.bat delete mode 100644 buildpacks/hello-moon-windows/buildpack.toml delete mode 100644 buildpacks/hello-universe-windows/README.md delete mode 100644 buildpacks/hello-universe-windows/buildpack.toml delete mode 100644 buildpacks/hello-universe-windows/package.toml delete mode 100644 buildpacks/hello-world-windows/README.md delete mode 100644 buildpacks/hello-world-windows/bin/build.bat delete mode 100644 buildpacks/hello-world-windows/bin/detect.bat delete mode 100644 buildpacks/hello-world-windows/buildpack.toml delete mode 100644 buildpacks/hello-world-windows/package.toml diff --git a/Makefile b/Makefile index 491e4776..25aaa0c4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PULL_POLICY_NEVER?=--pull-policy=never PACK_BUILD_FLAGS?=--trust-builder PACK_CMD?=pack -clean: clean-linux clean-windows +clean: clean-linux #################### ## Linux @@ -153,109 +153,6 @@ set-experimental: @echo "> Setting experimental" $(PACK_CMD) config experimental true -#################### -## Windows -#################### - -build-windows-2022: build-windows-packages build-dotnet-framework-2022 build-nanoserver-2022 - -build-nanoserver-2022: build-base-nanoserver-2022 build-builder-nanoserver-2022 build-buildpacks-nanoserver-2022 - -build-dotnet-framework-2022: build-base-dotnet-framework-2022 build-builder-dotnet-framework-2022 build-buildpacks-dotnet-framework-2022 - -build-base-nanoserver-2022: - @echo "> Building 'nanoserver-2022' base images..." - bash base-images/build.sh nanoserver-2022 - -build-base-dotnet-framework-2022: - @echo "> Building 'dotnet-framework-2022' base images..." - bash base-images/build.sh dotnet-framework-2022 - -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-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) - - @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..." - $(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-2022 -v --builder cnbs/sample-builder:dotnet-framework-2022 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS) - -build-windows-packages: build-sample-root - @echo "> Creating 'hello-world-windows' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-world-windows/package.toml $(PULL_POLICY_NEVER) - - @echo "> Creating 'hello-universe-windows' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-universe-windows/package.toml $(PULL_POLICY_NEVER) - -deploy-windows-packages: - @echo "> Deploying windows packages..." - docker push cnbs/sample-package:hello-world-windows - docker push cnbs/sample-package:hello-universe-windows - -deploy-windows-2022: deploy-windows-bases-2022 deploy-windows-builders-2022 - -deploy-windows-bases-2022: deploy-windows-bases-dotnet-framework-2022 deploy-windows-bases-nanoserver-2022 - -deploy-windows-bases-nanoserver-2022: - @echo "> Deploying 'nanoserver-2022' base images..." - docker push cnbs/sample-base:nanoserver-2022 - docker push cnbs/sample-base-run:nanoserver-2022 - docker push cnbs/sample-base-build:nanoserver-2022 - -deploy-windows-bases-dotnet-framework-2022: - @echo "> Deploying 'dotnet-framework-2022' base images..." - docker push cnbs/sample-base-run:dotnet-framework-2022 - docker push cnbs/sample-base-build:dotnet-framework-2022 - -deploy-windows-builders-2022: deploy-windows-builders-dotnet-framework-2022 deploy-windows-builders-nanoserver-2022 - -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-2022' base images..." - docker rmi cnbs/sample-base:nanoserver-2022 || true - docker rmi cnbs/sample-base-run:nanoserver-2022 || true - docker rmi cnbs/sample-base-build:nanoserver-2022 || true - - @echo "> Removing 'dotnet-framework-2022' base images..." - docker rmi cnbs/sample-base-run:dotnet-framework-2022 || true - docker rmi cnbs/sample-base-build:dotnet-framework-2022 || true - - @echo "> Removing builders..." - docker rmi cnbs/sample-builder:nanoserver-2022 || true - docker rmi cnbs/sample-builder:dotnet-framework-2022 || 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 - - @echo "> Removing packages..." - docker rmi cnbs/sample-package:hello-world-windows || true - docker rmi cnbs/sample-package:hello-universe-windows || true - - @echo "> Removing '.tmp'" - rm -rf .tmp - #################### ## Windows pack for any daemon OS #################### diff --git a/base-images/dotnet-framework-2022/base/Dockerfile b/base-images/dotnet-framework-2022/base/Dockerfile deleted file mode 100644 index 22232b77..00000000 --- a/base-images/dotnet-framework-2022/base/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 - -# Set required CNB target information -ARG distro_name -LABEL io.buildpacks.base.distro.name=${distro_name} -ARG distro_version -LABEL io.buildpacks.base.distro.version=${distro_version} - -# Set deprecated CNB stack information (see https://buildpacks.io/docs/reference/spec/migration/platform-api-0.11-0.12/#stacks-are-deprecated-1) -ARG stack_id -LABEL io.buildpacks.stack.id=${stack_id} diff --git a/base-images/dotnet-framework-2022/build/Dockerfile b/base-images/dotnet-framework-2022/build/Dockerfile deleted file mode 100644 index a24970e0..00000000 --- a/base-images/dotnet-framework-2022/build/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -ARG base_image -FROM ${base_image} - -# Set user -USER ContainerAdministrator - -# Set required CNB user information -ARG cnb_uid=1 -ARG cnb_gid=1 -# non-zero sets all user-owned directories to BUILTIN\Users -ENV CNB_USER_ID=${cnb_uid} -ENV CNB_GROUP_ID=${cnb_gid} - -# Set deprecated CNB stack information (see https://buildpacks.io/docs/reference/spec/migration/platform-api-0.11-0.12/#stacks-are-deprecated-1) -ARG stack_id -ENV CNB_STACK_ID=${stack_id} diff --git a/base-images/dotnet-framework-2022/run/Dockerfile b/base-images/dotnet-framework-2022/run/Dockerfile deleted file mode 100644 index 86e23289..00000000 --- a/base-images/dotnet-framework-2022/run/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -ARG base_image -FROM ${base_image} - -# Create unresolved symlink from c:\inetpub\wwwroot to c:\workspace -RUN powershell -Command \ - 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 - -# Set user -USER ContainerAdministrator diff --git a/base-images/nanoserver-2022/base/Dockerfile b/base-images/nanoserver-2022/base/Dockerfile deleted file mode 100755 index 6a3b2887..00000000 --- a/base-images/nanoserver-2022/base/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 - -# launcher requires a non-empty PATH to workaround https://github.com/buildpacks/pack/issues/800 -ENV PATH c:\\Windows\\system32;C:\\Windows - -# Set required CNB target information -ARG distro_name -LABEL io.buildpacks.base.distro.name=${distro_name} -ARG distro_version -LABEL io.buildpacks.base.distro.version=${distro_version} - -# Set deprecated CNB stack information (see https://buildpacks.io/docs/reference/spec/migration/platform-api-0.11-0.12/#stacks-are-deprecated-1) -ARG stack_id -LABEL io.buildpacks.stack.id=${stack_id} diff --git a/base-images/nanoserver-2022/build/Dockerfile b/base-images/nanoserver-2022/build/Dockerfile deleted file mode 100755 index c3ca8d6c..00000000 --- a/base-images/nanoserver-2022/build/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -ARG base_image -FROM ${base_image} - -# Set user -USER ContainerUser - -# Set required CNB user information -ARG cnb_uid=1 -ARG cnb_gid=1 -# non-zero sets all user-owned directories to BUILTIN\Users -ENV CNB_USER_ID=${cnb_uid} -ENV CNB_GROUP_ID=${cnb_gid} - -# Set deprecated CNB stack information (see https://buildpacks.io/docs/reference/spec/migration/platform-api-0.11-0.12/#stacks-are-deprecated-1) -ARG stack_id -ENV CNB_STACK_ID=${stack_id} diff --git a/base-images/nanoserver-2022/run/Dockerfile b/base-images/nanoserver-2022/run/Dockerfile deleted file mode 100755 index 51505061..00000000 --- a/base-images/nanoserver-2022/run/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -ARG base_image -FROM ${base_image} - -# Set user -USER ContainerUser diff --git a/builders/dotnet-framework-2022/README.md b/builders/dotnet-framework-2022/README.md deleted file mode 100644 index 0bd7ac19..00000000 --- a/builders/dotnet-framework-2022/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Sample .NET Framework 2022 Builder - -### Prerequisites -* Docker with Windows Containers and support for 2022 images - -### Usage - -#### Creating the builder - -```bash -pack builder create cnbs/sample-builder:dotnet-framework-2022 --config builder.toml -``` - -#### Build app with builder - -```bash -pack build sample-app --builder cnbs/sample-builder:dotnet-framework-2022 --trust-builder --path ../../apps/aspnet -``` - -#### Run built app -``` -docker run --rm -it -p 8080:80 sample-app -``` diff --git a/builders/dotnet-framework-2022/builder.toml b/builders/dotnet-framework-2022/builder.toml deleted file mode 100644 index 46c6d0a1..00000000 --- a/builders/dotnet-framework-2022/builder.toml +++ /dev/null @@ -1,24 +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" - -# Base images used to create the builder -[build] -image = "cnbs/sample-base-build:dotnet-framework-2022" -[run] -[[run.images]] -image = "cnbs/sample-base-run:dotnet-framework-2022" - -# Stack (deprecated) used to create the builder -[stack] -id = "io.buildpacks.samples.stacks.dotnet-framework-2022" -build-image = "cnbs/sample-base-build:dotnet-framework-2022" -run-image = "cnbs/sample-base-run:dotnet-framework-2022" diff --git a/builders/nanoserver-2022/README.md b/builders/nanoserver-2022/README.md deleted file mode 100644 index 1cb07be8..00000000 --- a/builders/nanoserver-2022/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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-2022/builder.toml b/builders/nanoserver-2022/builder.toml deleted file mode 100644 index 320359df..00000000 --- a/builders/nanoserver-2022/builder.toml +++ /dev/null @@ -1,22 +0,0 @@ -# Buildpacks to include in builder -[[buildpacks]] -uri = "docker://cnbs/sample-package:hello-universe-windows" - -# Order used for detection -[[order]] -[[order.group]] -id = "samples/hello-universe-windows" -version = "0.0.1" - -# Base images used to create the builder -[build] -image = "cnbs/sample-base-build:nanoserver-2022" -[run] -[[run.images]] -image = "cnbs/sample-base-run:nanoserver-2022" - -# Stack (deprecated) used to create the builder -[stack] -id = "io.buildpacks.samples.stacks.nanoserver-2022" -build-image = "cnbs/sample-base-build:nanoserver-2022" -run-image = "cnbs/sample-base-run:nanoserver-2022" diff --git a/buildpacks/dotnet-framework/bin/build.bat b/buildpacks/dotnet-framework/bin/build.bat deleted file mode 100644 index e6accbb3..00000000 --- a/buildpacks/dotnet-framework/bin/build.bat +++ /dev/null @@ -1,45 +0,0 @@ -@echo off - -set env_dir=%2\env -set layers_dir=%1 -set plan_path=%$3 - -set launch_toml_path=%layers_dir%\launch.toml -set layer_toml_path=%layers_dir%\dotnet-framework.toml -set layer_path=%layers_dir%\dotnet-framework -set publish_path=%TEMP%\publish - -if not exist %layer_path% ( - mkdir %layer_path% -) - -if not exist %layer_toml_path% ( - ( - echo [types] - echo launch = false - echo build = true - echo cache = true - ) > %layer_toml_path% -) - -if not exist %publish_path% ( - mkdir %publish_path% -) - -set NUGET_PACKAGES=%layer_path% - -nuget restore -if %ERRORLEVEL% NEQ 0 ( - exit /b %ERRORLEVEL% -) - -MSBuild /t:Rebuild /p:Configuration=Debug -if %ERRORLEVEL% NEQ 0 ( - exit /b %ERRORLEVEL% -) - -( -echo [[processes]] -echo type = "web" -echo command = ["C:\\ServiceMonitor.exe", "w3svc"] -) >> %launch_toml_path% diff --git a/buildpacks/dotnet-framework/bin/detect.bat b/buildpacks/dotnet-framework/bin/detect.bat deleted file mode 100644 index d7ddbcb2..00000000 --- a/buildpacks/dotnet-framework/bin/detect.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off - -set plan_path=%2 - -if exist c:\workspace\*.sln ( - ( - echo [[requires]] - echo name = "dotnet-framework" - - echo [[provides]] - echo name = "dotnet-framework" - ) >> %plan_path% - - echo Detection PASSED - exit 0 -) diff --git a/buildpacks/dotnet-framework/buildpack.toml b/buildpacks/dotnet-framework/buildpack.toml deleted file mode 100755 index 203b78c5..00000000 --- a/buildpacks/dotnet-framework/buildpack.toml +++ /dev/null @@ -1,18 +0,0 @@ -# Buildpack API version -api = "0.10" - -# Buildpack ID and metadata -[buildpack] -id = "samples/dotnet-framework" -version = "0.0.1" -name = "Sample .NET Framework Buildpack" - -# Targets the buildpack will work with -[[targets]] -os = "windows" -[[targets.distros]] -version = "10.0.20348.1906" - -# Stacks (deprecated) the buildpack will work with -[[stacks]] -id = "io.buildpacks.samples.stacks.dotnet-framework-2022" diff --git a/buildpacks/dotnet-framework/package.toml b/buildpacks/dotnet-framework/package.toml deleted file mode 100755 index c79a10de..00000000 --- a/buildpacks/dotnet-framework/package.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[buildpacks]] -uri = "." diff --git a/buildpacks/hello-moon-windows/README.md b/buildpacks/hello-moon-windows/README.md deleted file mode 100644 index 08abd79b..00000000 --- a/buildpacks/hello-moon-windows/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Sample: Hello Moon Buildpack - -A no-op buildpack whose intent is to show how buildpack dependencies work. This buildpack depends on [hello-world-windows](../hello-world-windows). - -### Usage - -```bash -pack build sample-hello-moon-windows-app --builder cnbs/sample-builder:alpine --buildpack ../hello-world-windows/ --buildpack . -``` diff --git a/buildpacks/hello-moon-windows/bin/build.bat b/buildpacks/hello-moon-windows/bin/build.bat deleted file mode 100644 index 97f6bbac..00000000 --- a/buildpacks/hello-moon-windows/bin/build.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off - -echo --- Hello Moon buildpack - -:: INPUT ARGUMENTS -set platform_dir=%2 -set env_dir=%platform_dir%\env -set layers_dir=%1 -set plan_path=%3 - -:: ENV VARS -echo env_dir: %env_dir% -echo env_vars: -for /f "tokens=*" %%f in ('dir /s /q /b %env_dir%') do ( - for /f %%v in ('type %%f') do ( - set %%~nf=%%v - ) -) -for /f "tokens=*" %%o in ('set') do ( - echo %%o -) - -:: LAYERS -echo layers_dir: %layers_dir% - -:: PLAN -echo plan_path: %plan_path% -echo plan contents: -for /f "tokens=*" %%o in ('type %plan_path%') do ( - echo %%o -) - -echo --- Done diff --git a/buildpacks/hello-moon-windows/bin/detect.bat b/buildpacks/hello-moon-windows/bin/detect.bat deleted file mode 100644 index c39ddd43..00000000 --- a/buildpacks/hello-moon-windows/bin/detect.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off - -:: 1. GET ARGS -set plan_path=%2 - -:: 2. DECLARE DEPENDENCIES (OPTIONAL) -( -echo [[requires]] -echo name = "some-world" -echo version = "0.1" - -echo [requires.metadata] -echo world = "Earth-616" -) >> %plan_path% - -exit /b 0 diff --git a/buildpacks/hello-moon-windows/buildpack.toml b/buildpacks/hello-moon-windows/buildpack.toml deleted file mode 100644 index 09e55d89..00000000 --- a/buildpacks/hello-moon-windows/buildpack.toml +++ /dev/null @@ -1,20 +0,0 @@ -# Buildpack API version -api = "0.10" - -# Buildpack ID and metadata -[buildpack] -id = "samples/hello-moon-windows" -version = "0.0.1" -name = "Hello Moon Buildpack" -homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-moon-windows" - -# Targets the buildpack will work with -[[targets]] -os = "windows" - -# Stacks (deprecated) the buildpack will work with -[[stacks]] -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 deleted file mode 100644 index f409c379..00000000 --- a/buildpacks/hello-universe-windows/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Sample: Hello Universe Buildpack - -A no-op meta-buildpack whose intent is to show how meta-buildpacks are constructed. - -### Usage - -```bash -pack build sample-hello-universe-windows-app \ - --builder cnbs/sample-builder:nanoserver-2022 \ - --buildpack . \ - --buildpack ../hello-world-windows/ \ - --buildpack ../hello-moon-windows/ -``` diff --git a/buildpacks/hello-universe-windows/buildpack.toml b/buildpacks/hello-universe-windows/buildpack.toml deleted file mode 100644 index add35f5d..00000000 --- a/buildpacks/hello-universe-windows/buildpack.toml +++ /dev/null @@ -1,19 +0,0 @@ -# Buildpack API version -api = "0.10" - -# Buildpack ID and metadata -[buildpack] -id = "samples/hello-universe-windows" -version = "0.0.1" -name = "Hello Universe Buildpack" -homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-universe-windows" - -# Order used for detection -[[order]] -[[order.group]] -id = "samples/hello-world-windows" -version = "0.0.1" - -[[order.group]] -id = "samples/hello-moon-windows" -version = "0.0.1" diff --git a/buildpacks/hello-universe-windows/package.toml b/buildpacks/hello-universe-windows/package.toml deleted file mode 100644 index dc1ecac0..00000000 --- a/buildpacks/hello-universe-windows/package.toml +++ /dev/null @@ -1,13 +0,0 @@ -[buildpack] -uri = "." - -[[dependencies]] -uri = "../hello-moon-windows" - -[[dependencies]] -uri = "../hello-world-windows" -# Alternatively, to use an image while packaging, you can use: -# uri = "docker://cnbs/sample-package:hello-world-windows" - -[platform] -os = "windows" diff --git a/buildpacks/hello-world-windows/README.md b/buildpacks/hello-world-windows/README.md deleted file mode 100644 index 1554bbee..00000000 --- a/buildpacks/hello-world-windows/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Sample: Hello Windows Buildpack - -A no-op buildpack whose intent is to show minimal requirements of a buildpack on Windows. - -### Prerequisites -* Docker with Windows Containers and support for 2022 images - -### Usage - -```bash -pack build sample-hello-world-windows-app --builder cnbs/sample-builder:nanoserver-2022 --buildpack . --trust-builder -``` - -THEN - -``` -docker run sample-hello-world-windows-app echo hello -``` diff --git a/buildpacks/hello-world-windows/bin/build.bat b/buildpacks/hello-world-windows/bin/build.bat deleted file mode 100644 index 47cca726..00000000 --- a/buildpacks/hello-world-windows/bin/build.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo off - -echo --- Hello World buildpack - -:: INPUT ARGUMENTS -set platform_dir=%2 -set env_dir=%platform_dir%\env -set layers_dir=%1 -set plan_path=%3 - -:: PLATFORM DIR -echo platform_dir files: -for /f "tokens=*" %%o in ('dir /s /q /b %platform_dir%') do ( - echo %%o -) - -:: ENV VARS -echo env_dir: %env_dir% -echo env_vars: -for /f "tokens=*" %%f in ('dir /s /q /b %env_dir%') do ( - for /f %%v in ('type %%f') do ( - set %%~nf=%%v - ) -) -for /f "tokens=*" %%o in ('set') do ( - echo %%o -) - -:: LAYERS -echo layers_dir: %layers_dir% - -:: PLAN -echo plan_path: %plan_path% -echo plan contents: -for /f "tokens=*" %%o in ('type %plan_path%') do ( - echo %%o -) - -echo --- Done diff --git a/buildpacks/hello-world-windows/bin/detect.bat b/buildpacks/hello-world-windows/bin/detect.bat deleted file mode 100644 index c7da9a31..00000000 --- a/buildpacks/hello-world-windows/bin/detect.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off - -:: 1. GET ARGS -set plan_path=%2 - -:: 2. DECLARE DEPENDENCIES (OPTIONAL) -( -echo [[provides]] -echo name = "some-world" - -echo [[requires]] -echo name = "some-world" -) >> %plan_path% - -exit /b 0 diff --git a/buildpacks/hello-world-windows/buildpack.toml b/buildpacks/hello-world-windows/buildpack.toml deleted file mode 100644 index 7c559cd0..00000000 --- a/buildpacks/hello-world-windows/buildpack.toml +++ /dev/null @@ -1,22 +0,0 @@ -# Buildpack API version -api = "0.10" - -# Buildpack ID and metadata -[buildpack] -id = "samples/hello-world-windows" -version = "0.0.1" -name = "Hello World Buildpack" -homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-world-windows" - -# Targets the buildpack will work with -[[targets]] -os = "windows" -[[targets.distros]] -version = "10.0.20348.1906" - -# Stacks (deprecated) the buildpack will work with -[[stacks]] -id = "io.buildpacks.samples.stacks.nanoserver-2022" - -[[stacks]] -id = "io.buildpacks.samples.stacks.dotnet-framework-2022" diff --git a/buildpacks/hello-world-windows/package.toml b/buildpacks/hello-world-windows/package.toml deleted file mode 100644 index 66c7fe53..00000000 --- a/buildpacks/hello-world-windows/package.toml +++ /dev/null @@ -1,5 +0,0 @@ -[buildpack] -uri = "." - -[platform] -os = "windows" From a0c91d85e5ee91d650dd6dbc7508cdaadded3021 Mon Sep 17 00:00:00 2001 From: Aidan Delaney Date: Mon, 10 Feb 2025 07:55:31 +0000 Subject: [PATCH 2/2] Remove Windows platform CI Our examples only build WCOW images on Windows. Re-add Windows CI platform when we have LCOW examples. Signed-off-by: Aidan Delaney --- .github/workflows/build-and-deploy.yml | 79 -------------------------- 1 file changed, 79 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 21abbf6f..57b2027d 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -51,82 +51,3 @@ jobs: run: make deploy-linux - name: Clean up run: make clean-linux - build-deploy-windows: - strategy: - matrix: - include: - - os: windows-2022 - version: 2022 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - name: Determine download URL for latest pack - id: pack-download-url - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - result-encoding: string - # FIXME: Revert back to 'getLatestRelease' when pack v0.31.0 is released - script: | - return github.rest.repos.getReleaseByTag({ - owner: "buildpacks", - repo: "pack", - tag: "v0.31.0-rc1" - }).then(result => { - return result.data.assets - .filter(a => a.name.includes("windows")) - .map(a => a.browser_download_url)[0]; - }) - - name: Install pack - run: | - curl -s -L -o pack.zip ${{ steps.pack-download-url.outputs.result }} - tar -xvf pack.zip - mkdir ~\.pack - - name: Set Experimental - run: make set-experimental - - name: Build - run: make build-windows-${{ matrix.version }} - - uses: azure/docker-login@v1 - if: ${{ github.ref == 'refs/heads/main' }} - with: - username: cnbs - password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Deploy - if: ${{ github.ref == 'refs/heads/main' }} - run: make deploy-windows-${{ matrix.version }} - build-deploy-windows-packages: - runs-on: windows-2022 - steps: - - uses: actions/checkout@v3 - - name: Determine download URL for latest pack - id: pack-download-url - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - result-encoding: string - script: | - return github.rest.repos.getLatestRelease({ - owner: "buildpacks", - repo: "pack" - }).then(result => { - return result.data.assets - .filter(a => a.name.includes("windows")) - .map(a => a.browser_download_url)[0]; - }) - - name: Install pack - run: | - curl -s -L -o pack.zip ${{ steps.pack-download-url.outputs.result }} - tar -xvf pack.zip - mkdir ~\.pack - - name: Set Experimental - run: make set-experimental - - name: Build - run: make build-windows-packages - - uses: azure/docker-login@v1 - if: ${{ github.ref == 'refs/heads/main' }} - with: - username: cnbs - password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Deploy - if: ${{ github.ref == 'refs/heads/main' }} - run: make deploy-windows-packages