docker / cli

The Docker CLI
Apache License 2.0
4.94k stars 1.93k forks source link

pb #3259

Closed Applequist closed 3 years ago

Applequist commented 3 years ago

Hi,

I have just install Docker Desktop for Mac (Intel)

$ docker version
Client:
 Cloud integration: 1.0.17
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:55:20 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:10 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
  compose: Docker Compose (Docker Inc., v2.0.0-rc.1)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 3
  Running: 1
  Paused: 0
  Stopped: 2
 Images: 5
 Server Version: 20.10.8
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e25210fe30a0a703442421b0f60afac609f950a3
 runc version: v1.0.1-0-g4144b63
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.47-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 1.938GiB
 Name: docker-desktop
 ID: 64LD:YAMA:TGDB:R65O:JGIE:7X42:EHKB:EV5R:4P34:N5QU:75UL:7KAV
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

and try to run the getting started from the site at: https://docs.docker.com/get-started/02_our_app/ When building the docker image with 'docker build -t getting-started .' I get the following error:

$ docker login
Authenticating with existing credentials...
Login Succeeded

$ docker build -t getting-started .
[+] Building 2.6s (4/4) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                            0.0s
 => => transferring dockerfile: 191B                                                                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                                                 0.0s
 => ERROR [internal] load metadata for docker.io/library/node:12-apline           <<<< ERROR HERE                                                                                                         2.5s
 => [auth] library/node:pull token for registry-1.docker.io                                                                                                                     0.0s
------
 > [internal] load metadata for docker.io/library/node:12-apline:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: docker.io/library/node:12-apline: not found

But if I try the tutorial from the Dashboard, it just works...

kl-22424:getting-started desoutb$  docker build -t docker101tutorial . 
[+] Building 7.6s (27/27) FINISHED                                              
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.05kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 52B                                           0.0s
 => [internal] load metadata for docker.io/library/nginx:alpine            6.2s
 => [internal] load metadata for docker.io/library/python:alpine           6.2s
 => [internal] load metadata for docker.io/library/node:12-alpine**          0.0s      <<<< OK HERE 
 => [auth] library/nginx:pull token for registry-1.docker.io               0.0s
 => [auth] library/python:pull token for registry-1.docker.io              0.0s
 => [internal] load build context                                          0.1s
 => => transferring context: 10.33MB                                       0.1s
 => [stage-5 1/3] FROM docker.io/library/nginx:alpine@sha256:bead42240255  0.0s
 => [base 1/4] FROM docker.io/library/python:alpine@sha256:e74b38ebb56eec  0.0s
 => [app-base 1/8] FROM docker.io/library/node:12-alpine                   0.0s
 => CACHED [base 2/4] WORKDIR /app                                         0.0s
 => CACHED [base 3/4] COPY requirements.txt .                              0.0s
 => CACHED [base 4/4] RUN pip install -r requirements.txt                  0.0s
 => [build 1/2] COPY . .                                                   0.0s
 => [build 2/2] RUN mkdocs build                                           1.0s
 => CACHED [app-base 2/8] RUN apk add --no-cache python g++ make           0.0s
 => CACHED [app-base 3/8] WORKDIR /app                                     0.0s
 => CACHED [app-base 4/8] COPY app/package.json app/yarn.lock ./           0.0s
 => CACHED [app-base 5/8] RUN yarn install                                 0.0s
 => CACHED [app-base 6/8] COPY app/spec ./spec                             0.0s
 => CACHED [app-base 7/8] COPY app/src ./src                               0.0s
 => CACHED [app-base 8/8] RUN yarn test                                    0.0s
 => CACHED [app-zip-creator 1/1] RUN rm -rf node_modules &&     apk add z  0.0s
 => CACHED [stage-5 2/3] COPY --from=app-zip-creator /app.zip /usr/share/  0.0s
 => [stage-5 3/3] COPY --from=build /app/site /usr/share/nginx/html        0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:0323a0fc83bf030084d14e35f03719c445c4dfe0d0f4b  0.0s
 => => naming to docker.io/library/docker101tutorial                       0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
thaJeztah commented 3 years ago

I think you made a typo somewhere; (apline instead of alpine);

docker.io/library/node:12-apline
thaJeztah commented 3 years ago

I don't think there's a bug to fix here (see above), so let me go ahead and close this ticket, but feel free to continue the conversation

Applequist commented 3 years ago

Oh gosh how embarrasing... They say to not copy/paste huh... I'll have to had that one in my vim abbreviation.

However am I still allowed to suggest a clearer error message? I have google that thing before creating an issue (I promise) and one I found in docker buildx (?) gave similar error message but was either fixed by login in or changing dns setting...

Any way thanks for looking into it

thaJeztah commented 3 years ago

Yes, buildkit's errors are both "verbose", and somewhat confusing (hard to find the underlying error); see my comment on https://github.com/docker/buildx/issues/415#issuecomment-831885487. I think there's a tracking issue somewhere in the buildkit repository for this (improving error messages), but I can't find it (perhaps it's not there, and I should create one).

crazy-max commented 3 years ago

I think there's a tracking issue somewhere in the buildkit repository for this

https://github.com/moby/buildkit/issues/1472

crazy-max commented 3 years ago

I think you made a typo somewhere; (apline instead of alpine);

docker.io/library/node:12-apline

Looking at this typo maybe this could be improved by checking flavors too for suggestions like it does in https://github.com/moby/buildkit/pull/2218 for some images. cc @tonistiigi

thaJeztah commented 3 years ago

I think there's a tracking issue somewhere in the buildkit repository for this

moby/buildkit#1472

Yeah, there's also https://github.com/moby/buildkit/issues/2176 and https://github.com/moby/buildkit/issues/799. I think https://github.com/moby/buildkit/issues/1472 may be a bit too "broad", as it's also (IIRC) for "debugging intermediate builds steps, etc. Perhaps we need a tracking issue / epic specifically about errors.