Error failed to fetch an image or build from source: no docker daemon available

I was having issues with local builds before (see Cannot deploy docker app: Could not find image - #17 by vvishnu-indian). Now, trying another build, a new error has popped up:

GOOS=linux GOARCH=amd64 go build -o app  github.com/andig/evcc-api
docker build --platform linux/amd64 -t andig/evcc-api --push .
[+] Building 3.2s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                             0.0s
 => => transferring dockerfile: 442B                                                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                                0.0s
 => => transferring context: 2B                                                                                                                                  0.0s
 => [internal] load metadata for docker.io/library/alpine:3                                                                                                      0.6s
 => [builder 1/2] FROM docker.io/library/alpine:3@sha256:124c7d2707904eea7431fffe91522a01e5a861a624ee31d03372cc1d138a3126                                        0.0s
 => => resolve docker.io/library/alpine:3@sha256:124c7d2707904eea7431fffe91522a01e5a861a624ee31d03372cc1d138a3126                                                0.0s
 => [internal] load build context                                                                                                                                0.3s
 => => transferring context: 24.68MB                                                                                                                             0.3s
 => CACHED [builder 2/2] RUN apk update && apk add --no-cache git ca-certificates tzdata && update-ca-certificates                                               0.0s
 => CACHED [stage-1 2/4] COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo                                                                             0.0s
 => CACHED [stage-1 3/4] COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/                                                                  0.0s
 => CACHED [stage-1 4/4] COPY app /usr/local/bin/app                                                                                                             0.0s
 => exporting to image                                                                                                                                           2.2s
 => => exporting layers                                                                                                                                          0.0s
 => => exporting manifest sha256:2308047c1ff188f33f7225a6b3cb97927f710cc085d68c6a7ba9da6154ddde0e                                                                0.0s
 => => exporting config sha256:ececf1da14d9d6e856fa983ab6a963e28aade0297394faad9f694f799d6039b7                                                                  0.0s
 => => exporting attestation manifest sha256:4811396952b274584950baab3585527ef1619a4a143830207c09eee659d14471                                                    0.0s
 => => exporting manifest list sha256:4833a089ecd4b18689046da93bd115634ae3f3dca81a8c5aeba8bf8ab6e99bea                                                           0.0s
 => => pushing layers                                                                                                                                            1.2s
 => => pushing manifest for docker.io/andig/evcc-api:latest@sha256:4833a089ecd4b18689046da93bd115634ae3f3dca81a8c5aeba8bf8ab6e99bea                              0.9s
docker pull --platform linux/amd64 andig/evcc-api
Using default tag: latest
latest: Pulling from andig/evcc-api
Digest: sha256:4833a089ecd4b18689046da93bd115634ae3f3dca81a8c5aeba8bf8ab6e99bea
Status: Image is up to date for andig/evcc-api:latest
docker.io/andig/evcc-api:latest
fly deploy --local-only
Update available 0.0.505 -> 0.0.506.
Run "fly version update" to upgrade.
==> Verifying app config
Validating /Users/andig/htdocs/api/fly.toml
Platform: nomad
✓ Configuration is valid
--> Verified app config
==> Building image
WARN Ignoring /Users/andig/htdocs/api/Dockerfile due to config
WARN failed to create build in graphql: input:3: createBuild Could not find App

Error failed to fetch an image or build from source: no docker daemon available


make: *** [fly] Error 1

Nothing has changed on local side. Running with DEBUG log I get the following additional info:

==> Building image
WARN Ignoring /Users/andig/htdocs/api/Dockerfile due to config
DEBUG trying local docker daemon
DEBUG Local docker daemon unavailable
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "\nmutation ResolverCreateBuild ($input: CreateBuildInput!) {\n\tcreateBuild(input: $input) {\n\t\tid\n\t\tstatus\n\t}\n}\n",
  "variables": {
    "input": {
      "appName": "",
      "builderType": "local",
      "clientMutationId": "",
      "imageOpts": {
        "buildArgs": null,
        "buildPacks": null,
        "builder": "",
        "builtIn": "",
        "builtInSettings": null,
        "dockerfilePath": "",
        "extraBuildArgs": null,
        "imageLabel": "",
        "imageRef": "andig/evcc-api",
        "noCache": false,
        "publish": true,
        "tag": "",
        "target": ""
      },
      "machineId": "",
      "strategiesAvailable": [
        "Local Image Reference",
        "Remote Image Reference"
      ]
    }
  },
  "operationName": "ResolverCreateBuild"
}
DEBUG {0x14000b014a0}
DEBUG <-- 200 https://api.fly.io/graphql (150.61ms)

{
  "data": {
    "createBuild": null
  },
  "errors": [
    {
      "message": "Could not find App",
      "locations": [
        {
          "line": 3,
          "column": 2
        }
      ],
      "path": [
        "createBuild"
      ],
      "extensions": {
        "code": "NOT_FOUND"
      }
    }
  ]
}
WARN failed to create build in graphql: input:3: createBuild Could not find App

DEBUG Trying 'Local Image Reference' strategy
DEBUG result image:<nil> error:no docker daemon available
DEBUG Skipping FinishBuild() gql call, because CreateBuild() failed.

Error failed to fetch an image or build from source: no docker daemon available


make: *** [fly] Error 1

The fly.toml is simple:

# fly.toml file generated for evcc on 2021-08-12T17:07:42+02:00

app = "evcc-api"

kill_signal = "SIGTERM"

[build]
  image = "andig/evcc-api"

[env]
  ...
  
[mounts]
  source="perm"
  destination="/data"
  
[[services]]
  internal_port = 80
  protocol = "tcp"

  [[services.ports]]
    handlers = ["http"]
    port = 80

[[services]]
  internal_port = 443
  protocol = "tcp"

  [services.concurrency]
    type = "requests"
    hard_limit = 2500
    soft_limit = 2000

  [[services.ports]]
    port = 443

So ist the Makefile:

fly:
	GOOS=linux GOARCH=amd64 go build -o app $(BUILD_TAGS) $(REPO)
	docker build --platform linux/amd64 -t $(DOCKER_IMAGE) --push .
	docker pull --platform linux/amd64 $(DOCKER_IMAGE)
	fly deploy --local-only

Looks like a problem with the builder again and/or the fly graphql api?

This part is really confusing:

The build log clearly shows that just before the image has been locally built.

Hey there!

Check out this : flyctl cannot find local docker instance - #6 by lc91

A user noticed that Docker on their mac didn’t have a symlink that was expected and had a similar-ish error.

Random other note: There have been updates toflyctl to be sure to compare what version you’re running and see if it’s the latest.

1 Like

Great find, thank you! Would never have found that one…

1 Like