Jenkins Docker pipeline plugin with docker run

Jenkins Docker pipeline plugin with docker run

Hi I know this probably is no longer needed, but I believe this is achievable by doing something like:

docker.image(mysql:5).withRun(-e MYSQL_ROOT_PASSWORD=my-secret-pw) { c ->
    sh docker logs ${c.id}
} 

This example was adapted from https://www.jenkins.io/doc/book/pipeline/docker/

Jenkins Docker pipeline plugin with docker run

Leave a Reply

Your email address will not be published.