error: failed to solve: snapshot does not exist: not found - docker

When running
docker buildx build --platform linux/arm64,linux/amd64,linux/arm/v7 -t my-project .
it fails with a very cryptic error message:
------
> [internal] load build context:
------
error: failed to solve: snapshot does not exist: not found
which I can't find in google.
This is on debian, I just switched from debian's docker.io for the docker-ce package to get buildx support.

This cryptic error is shown when using docker buildx with a buildx-capable docker command, but with the docker service still being the old non-buildx-capable one.
Manually restart the docker service with
service docker restart
(or similar, depending on your service system) and buildx will work just fine.

Related

Error during installing Docker on Windows Server 2016 (VMware Workstation)

I want to install and use docker on Server 2016 without docker dekstop(not supported). I am getting this error.
PS C:\Users\Administrator> docker run -t -i mcr.microsoft.com/windows/nanoserver:1809
Unable to find image 'mcr.microsoft.com/windows/nanoserver:1809' locally
1809: Pulling from windows/nanoserver
e2d245a3ce95: Extracting
[==================================================>] 103.3 MB/103.3 MB
C:\Program Files\docker\docker.exe: failed to register layer: re-exec
error: exit status 1: output: ProcessUtilityVMImage C:\ProgramData\docker\windowsfilter\a579423b585e834a4d02960cf2a96cccd4b69b4bfab7811774de7a83ad168729\UtilityVM:
The system cannot find the path specified..
See 'C:\Program Files\docker\docker.exe run --help'.
Thanks in advance for your help.
I was unable to install windowsServerCore container image with previous commands and then I entered the command: "docker run -t -i mcr.microsoft.com/windows/nanoserver:1809" to reach to offical page.

docker buildx failed to build amd64 image in system with architecture arm64

I am trying to build a docker image with command
docker buildx build --platform=linux/amd64 -f .devcontainer/Dockerfile .
it fails with error ERROR: unexpected end of JSON input
however docker build and run does not fail
what could this error mean ?
Looks like this is just a syntax error when specifying the architecture.
It would need to be this instead:
docker buildx build --platform linux/amd64 ...

Pushing buildx images to quay registry

I'm getting an error when pushing an image to quay using buildx. If I use a standard docker build I get no issues using the same credentials. I am doing this via Drone CI. I am getting the following error:
#17 exporting to image
#17 pushing layers 1.3s done
#17 ERROR: unexpected status: 401 UNAUTHORIZED
------
> exporting to image:
------
error: failed to solve: unexpected status: 401 UNAUTHORIZED
These are the commands I am running via CI:
- docker login -u="orgname+build_test" -p=$${DOCKER_PASSWORD} quay.io
- docker run --privileged --rm tonistiigi/binfmt --install all
- docker buildx create --name container --driver docker-container --use
- docker buildx build --platform linux/amd64,linux/arm/v7 -t quay.io/orgname/test:latest --output type=registry .
This is running in 19.03.12-dind image which I have added the build x plugin. I am able to run the build x commands but it fails to upload image to the quay registry.

docker: 'build' is not a docker command

I was following https://cloud.google.com/container-registry/docs/quickstart documentation to build the Docker image;
Run the following Docker command from the directory containing the image's files:
docker build -t quickstart-image .
But then I get the error message:
docker: 'build' is not a docker command.
My docker version: version 18.09.0, build 4d60db4
Why is the command not working? Is it because of my docker version?
not sure if you still have this problem, but could you verify that there are no hidden characters in your
docker build -t quickstart-image .
I get this error when I copy-paste from either libre office or word
funny fix for funny problems

Need docker to build docker?

I download the docker and want to compile it from the source code:
[root#localhost docker-1.5.0]# make
mkdir bundles
docker build -t "docker" .
/bin/sh: docker: command not found
make: *** [build] Error 127
Per my understanding, if I want to compile docker, I need to get a docker firstly. Is it right? If it is true, how does the first docker come?
yum or apt-get install docker-io will install the docker-io
then you build it from source and it replace the existing docker or set your path to point to the new docker.
You must have Docker to build Docker only because that's what the Docker guys thought would be the most convenient.
Of course, there is a way to compile the Docker source without having Docker installed on your machine; but then - you will have to have on your machine all the compilation tools and dependencies needed for the compilation.
So, the Docker team "dockerized" the compilation process. Namely, they used Docker itself, and what it is intended to do, also for the compilation of the Docker source.

Resources