Dockerfiles API
Offering: GitLab Self-Managed, GitLab Dedicated
GitLab은 전체 인스턴스에서 사용 가능한 Dockerfile 템플릿에 대한 API 엔드포인트를 제공합니다. Guest 권한을 가진 사용자는 Dockerfiles 템플릿에 액세스할 수 없습니다. GitLab Premium 및 Ultimate 티어에서 GitLab 인스턴스 관리자는 Admin 영역에서 템플릿을 재정의할 수 있습니다.
GitLab은 전체 인스턴스에서 사용 가능한 Dockerfile 템플릿에 대한 API 엔드포인트를 제공합니다.
기본 템플릿은 GitLab 리포지터리의 vendor/Dockerfile에 정의되어 있습니다.
Guest 권한을 가진 사용자는 Dockerfiles 템플릿에 액세스할 수 없습니다. 자세한 내용은 프로젝트 및 그룹 가시성을 참조하세요.
Dockerfile API 템플릿 재정의#
GitLab Premium 및 Ultimate 티어에서 GitLab 인스턴스 관리자는 Admin 영역에서 템플릿을 재정의할 수 있습니다.
모든 Dockerfile 템플릿 목록 조회#
모든 Dockerfile 템플릿을 나열합니다.
GET /templates/dockerfiles
요청 예시:
curl "https://gitlab.example.com/api/v4/templates/dockerfiles"
응답 예시:
[
{
"key": "Binary",
"name": "Binary"
},
{
"key": "Binary-alpine",
"name": "Binary-alpine"
},
{
"key": "Binary-scratch",
"name": "Binary-scratch"
},
{
"key": "Golang",
"name": "Golang"
},
{
"key": "Golang-alpine",
"name": "Golang-alpine"
},
{
"key": "Golang-scratch",
"name": "Golang-scratch"
},
{
"key": "HTTPd",
"name": "HTTPd"
},
{
"key": "Node",
"name": "Node"
},
{
"key": "Node-alpine",
"name": "Node-alpine"
},
{
"key": "OpenJDK",
"name": "OpenJDK"
},
{
"key": "PHP",
"name": "PHP"
},
{
"key": "Python",
"name": "Python"
},
{
"key": "Python-alpine",
"name": "Python-alpine"
},
{
"key": "Python2",
"name": "Python2"
},
{
"key": "Ruby",
"name": "Ruby"
},
{
"key": "Ruby-alpine",
"name": "Ruby-alpine"
},
{
"key": "Rust",
"name": "Rust"
},
{
"key": "Swift",
"name": "Swift"
}
]
단일 Dockerfile 템플릿 조회#
단일 Dockerfile 템플릿을 조회합니다.
GET /templates/dockerfiles/:key
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
key |
string | 예 | Dockerfile 템플릿의 키 |
요청 예시:
curl "https://gitlab.example.com/api/v4/templates/dockerfiles/Binary"
응답 예시:
{
"name": "Binary",
"content": "# This file is a template, and might need editing before it works on your project.\n# This Dockerfile installs a compiled binary into a bare system.\n# You must either commit your compiled binary into source control (not recommended)\n# or build the binary first as part of a CI/CD pipeline.\n\nFROM buildpack-deps:buster\n\nWORKDIR /usr/local/bin\n\n# Change `app` to whatever your binary is called\nAdd app .\nCMD [\"./app\"]\n"
}
