Skip to content

Instantly share code, notes, and snippets.

@a-shevtsov
Created October 6, 2018 01:08
Show Gist options
  • Save a-shevtsov/3d3dcadd7e3fce55e8c8b006e6061da7 to your computer and use it in GitHub Desktop.
Save a-shevtsov/3d3dcadd7e3fce55e8c8b006e6061da7 to your computer and use it in GitHub Desktop.
Running Docker container in Jenkins scripted pipeline
node {
// First parameter represents additional docker run options, second parameter is arguments passed to the image
// docker run [OPTIONS|<First parameter>] IMAGE [COMMAND] [ARG...|<Second parameter>]
docker.image('mesosphere/aws-cli').withRun('--entrypoint /bin/sh', '') {
stage('Build') {
sh 'aws --version'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment