Skip to content

Commit d7b13fd

Browse files
authored
Merge pull request cds-hooks#486 from buildpacks/feature/windows-2004
Add toggle for Windows tutorial
2 parents e02e6d8 + f459b4e commit d7b13fd

File tree

4 files changed

+47
-8
lines changed

4 files changed

+47
-8
lines changed

content/docs/app-developer-guide/build-a-windows-app.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ weight=2
44
summary="The basics of taking your Windows app from source code to runnable image."
55
+++
66

7-
> **EXPERIMENTAL:**
8-
>
9-
> - Please note that **Windows container support is currently experimental**. You may be asked to enable experimental features in `pack` when running the following commands. Simply follow the on-screen instructions to do so.
10-
> - If you encounter any problems while experimenting, we'd love for you to let us know by filing an issue on the [pack][pack-issues] or [lifecycle][lifecycle-issues] repo.
7+
### Precursor
118

12-
### Recommended reading
9+
#### Recommended reading
1310

1411
Before trying out builds for Windows images, we recommend following the [Linux image tutorial][app-journey] under [Getting Started][getting-started]. Don't worry, you can still run it on a Windows OS if you need to -- just make sure to [enable Linux containers][container-mode] for Docker first.
1512

1613
When you're done, head back here.
1714

18-
### Enable Windows container mode
15+
#### Enable Windows container mode
1916

2017
In order to produce Windows container images, ensure [Windows container mode][container-mode] is enabled in your Docker settings (available only in Docker for Windows).
2118

@@ -25,6 +22,28 @@ Then, building a Windows app using Cloud Native Buildpacks is nearly identical t
2522
>
2623
> `pack` can build Windows apps using a remote Windows Docker by setting a `DOCKER_HOST`. [Learn more](#using-remote-docker-hosts)
2724
25+
---
26+
27+
### 0. Determine Windows Version
28+
29+
Before we can start, we'll want to match your Windows environment.
30+
31+
Type the following command in PowerShell:
32+
33+
```powershell
34+
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | Format-Table -Property ReleaseId, CurrentBuild
35+
```
36+
37+
Select the output that best matches your environment:
38+
{{< page-replace-toggle >}}
39+
{{< page-replace-toggle-option search="2004" replace="1809" >}} Release ID: 1809, Build: <i>any</i> {{< /page-replace-toggle-option >}}
40+
{{< page-replace-toggle-option search="1809" replace="2004" >}} Release ID: 2009, Build: 1904<i>x</i> {{< /page-replace-toggle-option >}}
41+
{{< /page-replace-toggle >}}
42+
43+
<small>[Learn more about compatibility][compatibility].</small>
44+
45+
[compatibility]: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-2019%2Cwindows-10-20H2#windows-client-host-os-compatibility
46+
2847
### 1. Select a builder
2948

3049
To [build][build] an app you must first decide which [builder][builder] you're going to use. A builder
@@ -41,8 +60,11 @@ Now we can build our app. For this example we'll use our [samples][samples] repo
4160
# clone the repo
4261
git clone https://github.com/buildpacks/samples
4362

63+
# change directory to samples
64+
cd samples
65+
4466
# build the app
45-
pack build sample-app --path samples/apps/aspnet --builder cnbs/sample-builder:dotnet-framework-1809 --trust-builder
67+
pack build sample-app --path apps/aspnet --builder cnbs/sample-builder:dotnet-framework-1809 --trust-builder
4668
```
4769

4870
> **TIP:** The builder may take a few minutes to download on the first use.

themes/buildpacks/layouts/_default/baseof.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
{{ partial "meta.html" . }}
66

77
<script
8-
src="https://cdn.jsdelivr.net/combine/npm/[email protected],npm/[email protected],npm/[email protected],npm/[email protected]"></script>
8+
src="https://cdn.jsdelivr.net/combine/npm/[email protected],npm/[email protected],npm/[email protected],npm/[email protected],npm/[email protected]/replacetext.min.js"></script>
9+
910

1011
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"
1112
crossorigin="anonymous">
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<button type="button" class="btn btn-outline-primary" data-search='{{ .Get "search" }}' data-replace='{{ .Get "replace" }}'>
2+
{{- .Inner | markdownify -}}
3+
</button>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div id="page-replacer" class="btn-group py-2" role="group">
2+
{{- .Inner -}}
3+
</div>
4+
<script type="application/javascript">
5+
jQuery('#page-replacer button').on('click', function() {
6+
jQuery('#page-replacer button').removeClass('active');
7+
let el = this;
8+
jQuery(el).addClass('active');
9+
jQuery('.docs-content *:not([data-search])').replaceText(el.dataset.search, el.dataset.replace);
10+
});
11+
jQuery('#page-replacer button:first').click();
12+
</script>
13+

0 commit comments

Comments
 (0)