Skip to content

Commit 8ab6a58

Browse files
authored
add docs for ports and labels (#175)
1 parent 8103ac3 commit 8ab6a58

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

docs/ContainerCustomization.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,47 @@ By default, we use the `/app` directory as the working directory.
7979
<ContainerWorkingDirectory>/bin</ContainerWorkingDirectory>
8080
```
8181

82+
## ContainerPort
83+
84+
This item adds TCP or UDP ports to the list of known ports for the container. This enables container runtimes like Docker to map these ports to the host machine automatically. This is often used as documentation for the container, but can also be used to enable automatic port mapping.
85+
86+
ContainerPort items have two properties:
87+
* Include
88+
* The port number to expose
89+
* Type
90+
* One of `tcp` or `udp` - the default is `tcp`
91+
92+
```xml
93+
<ItemGroup>
94+
<ContainerPort Include="80" Type="tcp" />
95+
</ItemGroup>
96+
```
97+
98+
> **Note**
99+
> This item does nothing for the container by default and should be considered advisory at best.
100+
101+
## ContainerLabel
102+
103+
This item adds a metadata label to the container. Labels have no impact on the container at runtime, but are often used to store version and authoring metadata for use by security scanners and other infrastructure tools.
104+
105+
ContainerLabel items have two properties:
106+
* Include
107+
* The key of the label
108+
* Value
109+
* The value of the label - this may be empty
110+
111+
```xml
112+
<ItemGroup>
113+
<ContainerLabel Include="org.contoso.businessunit" Value="contoso-university" />
114+
<ItemGroup>
115+
```
116+
82117
## Unsupported properties
83118

84119
There are many other properties and items that we want to add support for in subsequent previews:
85120

86121
* Entrypoints
87122
* Entrypoint Arguments
88-
* Ports
89123
* Environment Variables
90-
* Labels
91124

92125
We expect to add them in future versions, so watch this space!

0 commit comments

Comments
 (0)