Skip to main content

dockerfile-and-readme-templating

Modify Cottle templates that generate Dockerfiles and READMEs in dotnet/dotnet-docker.

소스 정보

저장소
dotnet/dotnet-docker
최근 소스 활동
2026년 9월 8일 19:29
감지된 SKILL.md 언어
영어
스타
4,877
포크
1,978

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
dockerfile-and-readme-templating
description
Modify Cottle templates that generate Dockerfiles and READMEs in dotnet/dotnet-docker.
# Instructions for modifying Dockerfile templates All Dockerfiles and Readmes are generated from [Cottle](https://github.com/r3c/cottle) templates in the `eng/dockerfile-templates` and `eng/readme-templates` directories respectively. ## Cottle syntax ### Templating All text is plain text by default. Text inside double curly braces `{{ }}` is template code. Writing just `{{value}}` emits the evaluated value. You can also have expressions inside template blocks which do more complicated logic. Template code can have multiple lines in it, separated by the line ending `^` character. The final line in a template block should not use the line ending character. Comments inside a template block start with `_` and follow the same line ending rules. Comments can span multiple lines. ### Template data sources - `VARIABLES`: Variables from `manifest.versions.json`. Access with `VARIABLES["name"]`. - `ARGS`: Passed into template via `InsertTemplate(...)` function. Access with `ARGS["name"]` ### Common functions - Assign value: `set name to <expression>`. - Assign function `set func(arg1, arg2) to:{{ ... }}` defines an inline function; use `return <expr>` inside. - String functions: - `cat(a, b, ...)` - `join(list, sep)` - `split(str, sep)` - `slice(list, start, end)`. - Collections: - `len(list)`, - `find(haystack, needle)` returns index or -1. - Ternary expression: `when(condition, valueIfTrue, valueIfFalse)`. ### Conditionals Boolean expressions: - Operators: `=`, `!=`, `>`, `<`, `>=`, `<=`, logical `&&`, `||`, and negation `!`. - Equality uses single `=` inside expressions (context-specific to Cottle) rather than `==`. If statement: ```cottle {{if condition:VALUE}} ``` Compound conditionals: ```cottle {{if ((condition1 && condition2) || condition3):VALUE}} ``` Multiple conditions: ```cottle {{if condition1:VALUE1^ elif condition2:VALUE2^ else:VALUE3}} ``` After the colon `:`, all whitespace is treated as literal until the next line ending character `^`. You can also nest template blocks: ```cottle {{if condition1:{{if condition2:VALUE}}}} ```
GitHub에서 보기