Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit eac05ee2 authored by Dorian Turba's avatar Dorian Turba
Browse files

chore: readme

parent 25e1e994
No related branches found
No related tags found
No related merge requests found
......@@ -8,51 +8,53 @@ Build a Docker image and push it to the GitLab registry.
## How to use it
### Include the component/template
### Include the component
Add the following to your `.gitlab-ci.yml` file.
As a remote Template (recommended):
```yaml
include:
- remote: 'https://gitlab.com/swepy/cicd-templates/docker-build/-/raw/0.2.1/templates/docker-build.yml'
- component: $CI_SERVER_FQDN/swepy/cicd-templates/docker-build/docker-build@0.2.1
```
As a local Template (if the template is local to the instance):
```yaml
include:
- project: 'swepy/cicd-templates/docker-build'
ref: '0.2.1'
file: 'templates/docker-build.yml'
```
[![Supported by GitLab.com](https://img.shields.io/badge/Supported_by-GitLab.com-orange)](https://gitlab.com)
[![Supported by Frogg.it](https://img.shields.io/badge/Supported_by-Frogg.it-green)](https://froggit.fr/)
As a Component ([beta](https://gitlab.com/gitlab-org/gitlab/-/issues/407556) and if the
component is local to the instance):
### Inputs
```yaml
include:
- component: $CI_SERVER_FQDN/swepy/cicd-templates/docker-build/docker-build@0.2.1
```
You can customize the job by overriding specific inputs.
### Customize job
| Name | Description | Default |
|-------------------|----------------------------------------------------------|-------------------------------------|
| `stage` | Stage of the job. | `test` |
| `image_id` | Image name and tag of the built image. | `$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA` |
| `context_path` | Path to the build context, usually the project. | `.` |
| `dockerfile_name` | Name of the dockerfile. | `Dockerfile` |
| `docker_host` | Docker daemon host URL. | `tcp://docker:2375/` |
| `docker_driver` | Storage driver used by Docker. | `overlay2` |
| `kaniko_options` | Additional options to pass to Kaniko for image building. | `""` |
| `kaniko_tag` | Version tag of the Kaniko executor image. | `v1.23.2-debug` |
You can customize the job by overriding specific keys. For example:
For example:
```yaml
docker-build:
stage: build_img
```yml
include:
- component: $CI_SERVER_FQDN/swepy/cicd-templates/docker-build/docker-build@0.2.1
inputs:
stage: docker_build
context_path: ./project
```
## Variables
You can customize the job by overriding the following variables:
| Name | Description | Default |
|------------------|---------------------------------------|-------------------------------------|
| `DOCKER_HOST` | The path to the Docker Host | `tcp://docker:2375/` |
| `DOCKER_DRIVER` | The name of the Docker driver. | `overlay2` |
| `TARGET_IMAGE` | The nmae and tag of the target image. | `$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA` |
| `PROJECT_PATH` | The tag to apply to the image. | `.` |
| `KANIKO_OPTIONS` | The Kaniko options. | `""` |
| Name | Description | Default |
|-------------------|----------------------------------------------------------|---------------------------------|
| `IMAGE_ID` | Image name and tag of the built image. | `$[[ inputs.image_id ]]` |
| `CONTEXT_PATH` | Path to the build context, usually the project. | `$[[ inputs.context_path ]]` |
| `DOCKERFILE_NAME` | Name of the dockerfile. | `$[[ inputs.dockerfile_name ]]` |
| `DOCKER_HOST` | Docker daemon host URL. | `$[[ inputs.docker_host ]]` |
| `DOCKER_DRIVER` | Storage driver used by Docker. | `$[[ inputs.docker_driver ]]` |
| `KANIKO_OPTIONS` | Additional options to pass to Kaniko for image building. | `$[[ inputs.kaniko_options ]]` |
| `KANIKO_TAG` | Version tag of the Kaniko executor image. | `$[[ inputs.kaniko_tag ]]` |
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment