#3109·keploy

[bug]: If the current docker context is not default then use the correct context

Author: nehagupCreated Oct 9, 2025Updated Sep 10, 2026
LabelsbugGokeployHACKTOBERFESTHACKTOBERFEST2025

Is there an existing issue for this?

  • I have searched and didn't find similar issue

Current behavior

~/open-source/ecommerce_sample_app main !1 ❯ docker context ls                                                                                                       06:59:35 PM
NAME              DESCRIPTION                               DOCKER ENDPOINT                                  ERROR
colima            colima                                    unix:///Users/neha/.colima/default/docker.sock
default           Current DOCKER_HOST based configuration   unix:///var/run/docker.sock
desktop-linux *   Docker Desktop                            unix:///Users/neha/.docker/run/docker.sock
~/open-source/ecommerce_sample_app main !1 ❯ keploy record -c "docker compose up" --container-name="order_service" --build-delay 40 --path="./order_service" --config-path="./order_service"

       ▓██▓▄
    ▓▓▓▓██▓█▓▄
     ████████▓▒
          ▀▓▓███▄      ▄▄   ▄               ▌
         ▄▌▌▓▓████▄    ██ ▓█▀  ▄▌▀▄  ▓▓▌▄   ▓█  ▄▌▓▓▌▄ ▌▌   ▓
       ▓█████████▌▓▓   ██▓█▄  ▓█▄▓▓ ▐█▌  ██ ▓█  █▌  ██  █▌ █▓
      ▓▓▓▓▀▀▀▀▓▓▓▓▓▓▌  ██  █▓  ▓▌▄▄ ▐█▓▄▓█▀ █▓█ ▀█▄▄█▀   █▓█
       ▓▌                           ▐█▌                   █▌
        ▓

version: 2.11.5

 Keploy: 2025-10-09T19:01:04.154601+05:30 	INFO	Starting keploy in docker with image	{"image:": "ghcr.io/keploy/keploy:v2.11.5"}
 Keploy: 2025-10-09T19:01:04.220479+05:30 	INFO	Starting keploy in docker with default context, as that is the current context.
 Keploy: 2025-10-09T19:01:04.222794+05:30 	ERROR	failed to list docker volumes	{"error": "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"}
 Keploy: 2025-10-09T19:01:04.222816+05:30 	ERROR	failed to debugfs volume	{"error": "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"}
 Keploy: 2025-10-09T19:01:04.222824+05:30 	ERROR	failed to run the command in docker	{"error": "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"}
 Keploy: 2025-10-09T19:01:04.222833+05:30 	ERROR	failed to validate flags	{"error": "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"}
Usage:
  keploy record [flags]

Examples:
keploy record -c "/path/to/user/app"

Flags:
  -a, --app-id uint                A unique name for the user's application
      --app-name string            Name of the user's application
      --base-path string           Base URL to hit the server while recording the testcases
  -b, --build-delay uint           User provided time to wait docker container build (default 30)
      --cmd-type string            Type of command to start the user application (native/docker/docker-compose) (default "native")
  -c, --command string             Command to start the user application
      --config-path string         Path to the local directory where keploy configuration file is stored (default ".")
      --container-name string      Name of the application's docker container
      --dns-port uint32            Port used by the Keploy DNS server to intercept the DNS queries (default 26789)
      --generate-github-actions    Generate Github Actions workflow file
      --global-passthrough         Allow all outgoing calls to be mocked if set to true
  -h, --help                       help for record
      --in-ci                      is CI Running or not
      --metadata string            Metadata to be stored in config.yaml as key-value pairs (e.g., "key1=value1,key2=value2")
  -n, --network-name string        Name of the application's docker network
      --pass-through-ports uints   Ports to bypass the proxy server and ignore the traffic (default [])
  -p, --path string                Path to local directory where generated testcases/mocks are stored (default ".")
      --proxy-port uint32          Port used by the Keploy proxy server to intercept the outgoing dependency calls (default 16789)
      --record-timer duration      User provided time to record its application (e.g., "5s" for 5 seconds, "1m" for 1 minute)

Global Flags:
      --debug          Run in debug mode
      --disable-ansi   Disable ANSI color in logs

Steps to Replicate

run ~/open-source/ecommerce_sample_app main !1 ❯ keploy record -c "docker compose up" --container-name="order_service" --build-delay 40 --path="./order_service" --config-path="./order_service"

It will fail with above errors

Logs (if any)

[bug]: If the current docker context is not default then use the correct context

Operating system

MacOS

System Info (uname -a)

Darwin Nehas-MacBook-Pro.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000 arm64

OS Release Info (cat /etc/os-release)

No response

Docker Info (if applicable)

Current version: 4.37.2 (179585)

Your Environment

local

Version

Keploy 2.11.5

Repository

keploy

What use case were you trying? (optional)

No response