GitLab CI Kotlin DSL • opensavvy.gitlab.ci.plugins • Docker
Docker¶
class Docker
Integrate Docker into your build.
This plugin is responsible for adding the docker
extension to scripts:
val dockerBuild by job {
useDockerInDocker()
useContainerRegistry()
script {
docker.build("backend")
}
}
This plugin uses Docker in Docker, which can create security vulnerabilities. To build containers without using Docker in Docker, see the Kaniko
plugin.
Job extensions¶
This plugin provides the following job extensions:
-
useDockerInDocker
: configure the Docker In Docker service, -
useContainerRegistry
: logs in to the GitLab Container Registry of the current project.
Types¶
Companion
¶
object Companion
Functions¶
build
¶
Builds a Docker image from a Dockerfile.
logInToRegistry
¶
fun logInToRegistry(registry: String, username: String, password: String):
Logs in to an arbitrary container registry.
pull
¶
push
¶
Pushes the image
to a container registry.
rename
¶
Renames a version of an image
.