Git Product home page Git Product logo

Comments (12)

xyabc120 avatar xyabc120 commented on September 22, 2024 8

The ~/.docker folder already exists in my directory, and this issue still exists.
I resolved this issue by removing the currentContext attribute from the ~/.docker/config.json file

# set the property value to an empty string
"currentContext": ""
# or remove entire attribute
- "currentContext": "default"

from lazydocker.

hiro345g avatar hiro345g commented on September 22, 2024 3

As a temporary workaround, I was able to get it to work by specifying the DOCKER_HOST environment variable as DOCKER_HOST="unix:///var/run/docker.sock" lazydocker. (Ubuntu 22.04)

from lazydocker.

c3cris avatar c3cris commented on September 22, 2024 1

Same issue. Resolved by editing docker config, but that should not be the solution

from lazydocker.

mark2185 avatar mark2185 commented on September 22, 2024

Duplicate of #488.

from lazydocker.

alexravenna avatar alexravenna commented on September 22, 2024

The ~/.docker folder already exists in my directory, and this issue still exists. I resolved this issue by removing the currentContext attribute from the ~/.docker/config.json file

# set the property value to an empty string
"currentContext": ""
# or remove entire attribute
- "currentContext": "default"

This solved the issue for me too! Although it never feels good to delete something without even knowing what it does 😅 .

from lazydocker.

Jaap-van-Hengstum avatar Jaap-van-Hengstum commented on September 22, 2024

I can remove the currentContext and lazydocker starts working again, but I have to do that every time Docker Desktop restarts.

from lazydocker.

mark2185 avatar mark2185 commented on September 22, 2024

What if you set it to an empty string?

from lazydocker.

Jaap-van-Hengstum avatar Jaap-van-Hengstum commented on September 22, 2024

What if you set it to an empty string?

Also when I set it to an empty string.
Docker Desktop resets the currentContext back to the default value when it starts.

I seem to have two Docker contexts:

image

I don't know exactly what these do. I tried removing the desktop-linux context, but that also gets recreated when Docker Deskop restarts.

This is on Windows 11, Docker Desktop 4.25.0 and lazydocker 0.23.1

from lazydocker.

dwvwdv avatar dwvwdv commented on September 22, 2024

I've encountered the same issue, and @xyabc120's method helps me for now. Is this the only way to go?

from lazydocker.

guss77 avatar guss77 commented on September 22, 2024

I have the same issue - with ~/.docker/config.json having the line "currentContext": "default", lazydocker will not start.

Setting currentContext to the empty string works around the issue - but then docker-compose won't start:

$ lazydocker --version
Version: 0.23.1
Date: 2023-10-13T07:40:28Z
BuildSource: binaryRelease
Commit: 1060e17731c80372335446eabe6a56ba4facd2b3
OS: linux
Arch: amd64
$ lsb_release --codename
Codename:       jammy
$ docker-compose --version
docker-compose version 1.29.2, build unknown
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 80, in main
    command_func = dispatch()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 159, in dispatch
    options, handler, command_options = dispatcher.parse(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/compose/cli/docopt_command.py", line 28, in parse
    command_help, options, command = DocoptDispatcher.get_command_and_options(
  File "/usr/lib/python3/dist-packages/compose/cli/docopt_command.py", line 23, in get_command_and_options
    opt = docopt_full_help(command_help, argv, **options)
  File "/usr/lib/python3/dist-packages/compose/cli/docopt_command.py", line 9, in docopt_full_help
    return docopt(docstring, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docopt.py", line 575, in docopt
    extras(help, version, argv, doc)
  File "/usr/lib/python3/dist-packages/docopt.py", line 485, in extras
    sys.exit()
SystemExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 129, in main
    exit_with_metrics(command, log_msg=msg, status=status,
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 147, in exit_with_metrics
    MetricsCommand(command, status=status).send_metrics()
  File "/usr/lib/python3/dist-packages/compose/metrics/client.py", line 40, in __init__
    self.context = context_type or ContextAPI.get_current_context().context_type or 'moby'
AttributeError: 'NoneType' object has no attribute 'context_type'
$ docker-compose -p mtproject ps
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project
    client = get_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 143, in docker_client
    if not context.is_docker_host():
AttributeError: 'NoneType' object has no attribute 'is_docker_host'

Removing the currentContext completely makes both lazydocker and docker-compose work.

Interestingly, with currentContext set to the empty string, lazydocker works but does not show all docker-compose containers, and for some docker-compose containers it shows the wrong name.

from lazydocker.

RollsChris avatar RollsChris commented on September 22, 2024

same issue for me :( removing currentContext mkaes lazydocker work but then it gets its added back when restarting docker desktop.. making it unusable

from lazydocker.

RollsChris avatar RollsChris commented on September 22, 2024

weirdly if i use "docker context use default" it disappears from the config file and lazydocker works... but still restarting docker adds it back. Something has got twisted here maybe on the docker side.

Also it might be worth noting switching to desktop-linux context also works

from lazydocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.