How can I install cURL via circleCI on the grafana k6 image?

So in short I’m trying to run k6 tests in circleCI and get the output into datadog, frankly I’m in hell but trying a few different POCs.

One POC is using the grafana k6 image. I have my executor defined: (is there a way to add it here?)

    shell: /bin/sh --login
    working_directory: ~/project
      - image: grafana/k6:latest
    resource_class: small
      <<: *default_env_vars

My job then uses this:

    executor: load_test_executor
      - attach_workspace
      - run:
          command: |
            mkdir -p tmp/k6
            echo "directory created"
            k6 run load_tests/tests/backend/basicGET.js --out json=k6_load_test_results_image.json > tmp/k6/k6_load_test_results_image_output.json
            echo "k6 run complete"
      - store_artifacts:
            path: /tmp/k6
      - persist_to_workspace:
          root: .
            - tmp/k6
      - run:
          command: |
            echo "Load test complete"
            curl --help

The above all works fine. However where I have curl --help, I need curl. wget is no good as its a PUT. I tried basic commands with apk but get permissions issues. Given my above example, can I elevate permissions to root before needing curl somehow?

I DO NOT want to create a custom dockerfile

Hi @nicholaspshaw,
unfortunately, this is not the goal of the k6 docker image. We created it using the opposite approach, being as small as possible, to reduce the surface for security and maintenance reasons.

If you need additional tools you have to create your custom image extending the k6 image.