I’m working on a Jenkins pipeline using the grafana/k6:0.57.0
Docker image, but I’m encountering an issue where commands within the container (e.g., ls
, k6 version
, etc.) are not executing when using the sh
step. This setup used to work with the older loadimpact/k6
Docker image, where multiple tests could be triggered in the same container
podTemplate(label: LABEL, idleMinutes: 30,
containers: [
containerTemplate(name: 'k6-container', image: 'grafana/k6:0.57.0', command: 'cat', args: '', ttyEnabled: true ,alwaysPullImage: true)
]) {
node(LABEL) {
stage('Run Load Tests') {
container('k6-container') {
sh 'ls -al'
sh 'k6 version'
sh 'k6 cloud login --token TOKEN'
sh 'k6 cloud script.js'
}
}
}
}
Has anyone else encountered this issue with the grafana/k6
image? How can I modify the pipeline to allow the execution of shell commands within the container? I would appreciate any insights or suggestions.