Skip to content

ggcr: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? #1999

Closed

Description

What I got

󰀵  󱑍 14:49  ﱮ encore-nextjs/backend    main !?+27 via 🥟 v1.1.22 via  v20.15.1   8s 
 ➜  docker context ls                
NAME            DESCRIPTION                               DOCKER ENDPOINT                                   ERROR
default *       Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                       
desktop-linux   Docker Desktop                            unix:///home/imbios/.docker/desktop/docker.sock   

󰀵  󱑍 14:49  ﱮ encore-nextjs/backend    main !?+27 via 🥟 v1.1.22 via  v20.15.1 
 ➜  encore eject docker encore-nextjs
2:49PM INF compiling Encore application for linux/amd64
2:49PM INF saving image to local docker daemon
2:49PM ERR unable to save docker image error="error loading image: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"

What I expect

  • Successfully build the docker image.

Encore Version

encore version v1.39.5

Suspected Root Cause

The code that thrown the error:

https://github.com/encoredev/encore/blob/f8b785d73b213e01f25bbef44bccc5928b26d7e5/cli/daemon/export/export.go#L133-L147

Which from:

// write the image in docker save format first, then load it
resp, err := o.client.ImageLoad(o.ctx, pr, false)
if err != nil {
return "", fmt.Errorf("error loading image: %w", err)
}

Suspected related issues:

Related issues:

Command

encore eject docker encore-nextjs

Tried Potential Solution

  1. After identifying the selected docker context as desktop-Linux and its mismatch with the error given by encore, I switched it to default, and the error was still the same.
  2. After that, I thought it was similar to could not start process: exec: "node": executable file not found in $PATH encoredev/encore#1309, so I restarted my Ubuntu machine, but the error was still there.

Let me know if there is any other info you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions