Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dotnet framework 1809 and upgrade nanoserver #172

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
strategy:
matrix:
include:
- os: windows-2019
version: 1809
- os: windows-2022
version: 2022
runs-on: ${{ matrix.os }}
Expand Down
101 changes: 31 additions & 70 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/batch-script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/batch-script/batch-script-buildpack/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
23 changes: 0 additions & 23 deletions builders/dotnet-framework-1809/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions builders/dotnet-framework-1809/builder.toml

This file was deleted.

21 changes: 0 additions & 21 deletions builders/nanoserver-1809/README.md

This file was deleted.

21 changes: 21 additions & 0 deletions builders/nanoserver-2022/README.md
Original file line number Diff line number Diff line change
@@ -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._
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion buildpacks/dotnet-framework/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 1 addition & 4 deletions buildpacks/hello-moon-windows/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion buildpacks/hello-universe-windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions buildpacks/hello-world-windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildpacks/hello-world-windows/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
15 changes: 0 additions & 15 deletions stacks/dotnet-framework-1809/build/Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions stacks/dotnet-framework-1809/run/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand Down