K6 Docker Initialization failed while running in Azure Pipeline

Hi,

While running using k6 docker container in Azure Pipeline - getting error

Following in my docker file

FROM joined-docker.artifactory.abcdefgg.net/grafana/k6:0.50.0
RUN apt-get update
COPY . /app
USER root
RUN echo $NODE_EXTRA_CA_CERTS

Following is my yml file

trigger:

  • master

pool:
name: default-containers

stages:

  • stage: E2E_Perf_TEST
    jobs:

Error:
2024-05-23T08:38:32.6517873Z 9f89d995513a86b3cffe141920e151829e782234babeba0a61c4f149f92c0021 Up Less than a second

2024-05-23T08:38:32.6579027Z ##[command]/usr/bin/docker exec 9f89d995513a86b3cffe141920e151829e782234babeba0a61c4f149f92c0021 sh -c “command -v bash”

2024-05-23T08:38:32.7412942Z Error response from daemon: Container 9f89d995513a86b3cffe141920e151829e782234babeba0a61c4f149f92c0021 is not running

Hi @subp

From the message, it’s tough to say what’s wrong, but it definitely doesn’t look like the issue with the k6, but rather the pipeline configuration itself.

I’d recommend you follow the steps from the article about Azure Pipelines:

Primarily ensure that if you’re running the k6 inside docker, inside pipelines, use the right vmImage

# azure-pipelines.yml

pool:
  vmImage: 'ubuntu-18.04'

steps:
  - script: |
      docker pull grafana/k6
    displayName: Pull k6 image
  - script: |
      docker run -i \
        -e K6_CLOUD_TOKEN=$(K6_CLOUD_TOKEN) \
        -v `pwd`:/src \
        grafana/k6 \
        cloud /src/loadtest.js \
    displayName: Run cloud test

Hope that helps!

Cheer

1 Like