Skip to content

Instantly share code, notes, and snippets.

@initcron
Created July 8, 2020 09:33
Show Gist options
  • Save initcron/c116d02f15c9b085fa191eeaa99ffc74 to your computer and use it in GitHub Desktop.
Save initcron/c116d02f15c9b085fa191eeaa99ffc74 to your computer and use it in GitHub Desktop.
Docker Build and Publish Script Snippet for Jenkinsfile
docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') {
def dockerImage = docker.build("xxxxxx/xxxxx:v${env.BUILD_ID}", "./")
dockerImage.push()
dockerImage.push("latest")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment