Error: No such container: lambda_run - DOCKER - docker

I am having trouble creating a lambda .zip file in docker. I have followed a few tutorials but to no avail. I keep getting this error when running my .sh file
Unable to find image 'google_analytics_layer:latest' locally
docker: Error response from daemon: pull access denied for google_analytics_layer, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
no such directory
Error: No such container: lambda_run
Error: No such container:path: lambda_run:/python.zip
Error response from daemon: No such container: lambda_run
Error: No such container: lambda_run
docker: invalid reference format.
See 'docker run --help'.
no such directory
Error: No such container: lambda_run
Error: No such container:path: lambda_run:/python.zip
Error response from daemon: No such container: lambda_run
Error: No such container: lambda_run
Here is the code that I'm running
container_name=lambda_run
docker_image=google_analytics_layer
docker run -td --name $container_name $docker_image
docker cp ./requirements.txt $container_name:/
docker exec -i $container_name /bin/bash < ./docker_install.sh
docker cp $container_name:/python.zip python.zip
docker stop $container_name
docker rm $container_name
and this is the tutorial that I followed: https://www.youtube.com/watch?v=jXjMrWCpaI8

As with any list of steps, when one step depends on another you need to stop if there's an error. Your error is in the first step. You need to locate the image google_analytics_layer that you are looking for.
The script you are trying to run is clearly labelled runner.sh in the tutorial. It's to help you run the docker image. You need to create it before you can run it.
To create it:
docker build . -t google_analytics_layer

Related

Docker works but deamon is not responding

Could you help me with this interesting case:
my docker creates images and runs containers fine
BUT
when I'm trying to run tests from testcontainers with command
docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock my-image:1.0 mvn test
I receive
Error response from daemon: failed to create shim task: OCI runtime
create failed: runc create failed: unable to start container process:
exec: "mvn": executable file not found in $PATH: unknown.

docker: Error response from daemon: runtime "io.containerd.runc.v2" binary not installed "containerd-shim-runc-v2": file does not exist: unknown

After docker installation, I tried to run
docker run --rm hello-world
And get this error:
docker: Error response from daemon: runtime "io.containerd.runc.v2" binary not installed "containerd-shim-runc-v2": file does not exist: unknown.
ERRO[0000] error waiting for container: context canceled
I'm sure it's not the "right" solution, but I found a workaround on this site:
https://github.com/containerd/containerd/issues/3473#issuecomment-516887500
To solve it I did:
❯ find / -name containerd-shim-runc-v1
/usr/bin/containerd-shim-runc-v1
And then: (make sure that this is the right path in your machine)
sudo cp /usr/bin/containerd-shim-runc-v1 /usr/bin/containerd-shim-runc-v2

Docker: Unable to mount volume

I am trying to mount the volume on my customized image.
docker run --rm -v models:/volumes/models <image-name>:latest
or
docker run --rm <image-name>:latest
Its throwing same error for both commands:
docker: Error response from daemon: OCI runtime create failed: invalid mount {Destination:[/volumes/models] Type:bind Source:/mnt/data/docker/volumes/beb849ff1498450a01aa69c9b143e51b15fc8d97316d318cfbd4ab72f60656de/_data Options:[rbind]}: mount destination [/volumes/models] not absolute: unknown.
My Docker version is :
Docker version 19.03.13, build 4484c46d9d
To crosscheck the image, I have mounted the same volume on another server and it worked
Am I missing something?

Pull access denied in docker run command

I have the below code to build an image
docker build -t provisioner-builder:latest -f images/provisioner/Dockerfile.builder .
Right after this build command I have this line
docker run provisioner-builder:latest /bin/true
The docker run command always throws this error in jenkins
06:23:44 Successfully tagged provisioner-builder:latest
06:23:44 docker run provisioner-builder:latest /bin/true
06:23:45 docker: Error response from daemon: Error response from daemon: pull access denied for provisioner-builder, repository does not exist or may require 'docker login'.
06:23:45 See 'docker run --help'.
SO out of 15 runs in jenkins, the above step fails at-least 10-11 times. I get lucky very rarely. I am not trying to pull image as the image is already present in local [I tested by doing a docker images right after the build command and the image was locally present].
I dont understand why this command fails most of the times.

"Error response from daemon: lstat ...: no such file or directory" starting a Docker container

Getting the following error when starting container /usr/bin/docker run ac-jenkins
docker: Error response from daemon: lstat /var/lib/docker/overlay/
2704cc8045d14ab55f87e85913e17fd0a190aa1b89927630deccfcf5b8d05dc7:
no such file or directory.
try to run Jenkins docker by the following command it will run it properly
docker run -d -p 9090:8080 -p 50000:50000 -u root -v $PWD/jenkins:/var/jenkins_home jenkins
I got the below error,
`Error response from daemon: mkdir /mnt/sda1/var/lib/docker/tmp/************: no such
file or directory`
This was due to space unavailability. In windows, i had docker installed in C drive, it worked after deleting unwanted files and cleaned up disk space.
Try to increase the space of the directory where docker is installed.

Resources