Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jenkinsci/docker-commons-plugin
API plugin, which provides the common shared functionality for various Docker-related plugins.
https://github.com/jenkinsci/docker-commons-plugin
docker jenkins jenkins-api-plugin jenkins-plugin
Last synced: about 13 hours ago
JSON representation
API plugin, which provides the common shared functionality for various Docker-related plugins.
- Host: GitHub
- URL: https://github.com/jenkinsci/docker-commons-plugin
- Owner: jenkinsci
- License: mit
- Created: 2015-04-07T22:49:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-11-07T16:43:01.000Z (3 months ago)
- Last Synced: 2025-01-27T20:11:09.561Z (8 days ago)
- Topics: docker, jenkins, jenkins-api-plugin, jenkins-plugin
- Language: Java
- Homepage: https://plugins.jenkins.io/docker-commons/
- Size: 593 KB
- Stars: 44
- Watchers: 104
- Forks: 77
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Docker Commons API Plugin for Jenkins
[![Join the chat at https://gitter.im/jenkinsci/docker](https://badges.gitter.im/jenkinsci/docker.svg)](https://gitter.im/jenkinsci/docker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
API plugin, which provides the common shared functionality for various Docker-related plugins.
## Summary
* API for managing Docker image and container fingerprints
* Credentials and location of Docker Registry
* Credentials and location of Docker Daemon (aka Docker Remote API)
*ToolInstallation
for Docker CLI clients
*DockerImageExtractor
extension point to get Docker image relations from jobs
* Simple UI referring related image fingerprints in Docker builds
* etc.## Use-cases
### Credentials and locations
This allows users to configure one set of endpoint/credentials and use it across all the Docker related plugins,
thereby keeping configuration more [DRY](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself).See [Docker Pipeline Plugin](https://plugins.jenkins.io/docker-workflow) for the typical usage.
## Declarative pipeline example
An example on how to bind Docker host/daemon credentials in a declarative pipeline:
```groovy
pipeline {
agent any
tools {
// a bit ugly because there is no `@Symbol` annotation for the DockerTool
// see the discussion about this in PR 77 and PR 52:
// https://github.com/jenkinsci/docker-commons-plugin/pull/77#discussion_r280910822
// https://github.com/jenkinsci/docker-commons-plugin/pull/52
'org.jenkinsci.plugins.docker.commons.tools.DockerTool' '18.09'
}
environment {
DOCKER_CERT_PATH = credentials('id-for-a-docker-cred')
}
stages {
stage('foo') {
steps {
sh "docker version" // DOCKER_CERT_PATH is automatically picked up by the Docker client
}
}
}
}
```## License
[MIT License](http://opensource.org/licenses/MIT)
## Changelog
* See [GitHub Releases](https://github.com/jenkinsci/docker-commons-plugin/releases/latest) for the recent versions
* See [the release notes archive](https://github.com/jenkinsci/docker-commons-plugin/blob/2e09f1fe61389ef9a967a2bd362bc9d141807c86/CHANGELOG.md) for version `1.15` and older