Google Cloud Engine pull public docker image causes manifest unknown error - docker

I'm trying to run a docker image on a gce vm instance. I changed the core count and checked the box for deploying a container image. In the container image box I put docker.io/urw7rs/spiralpp:latest.
When I create the vm, I get an error : Attempting next endpoint for pull after error: manifest unknown: Failed to fetch \"latest\" from request \"/v2/urw7rs/spiralpp/manifests/latest\
I tried changing docker.io to registry.hub.docker.com, checked allow http and https traffic in firewall. I also tried running without any command and command arguments.
container options

I've reproduced your issue in my project and I found a workaround for this:
Please create a new instance using a Container-Optimized OS image.
Container-Optimized OS is an operating system image for your Compute Engine VMs that is optimized for running Docker containers, please refer to this guide to know how to install it.
I suggest you to avoid steps 4, 5 and 6, so you can use the docker commands within the instance to pull the image.
Don't forget to choose the latest version of Container-Optimized OS during the VM instance creation, to achieve this; once you've clicked on the "create instance" button, please search for the "Boot disk" section and click on the "Change" button; then go to the operating system option and select "Container-Optimized OS" and adjust the Size (GB) of the disk, please leave the version by default.
Once the VM instance is ready, please SSH the instance.
Once you're inside the instance, please run this command:
docker pull urw7rs/spiralpp:latest
Please run this command to check the image is being downloaded to your instance.
docker images
Please let me know the results.

Related

Testcontainers do not start after replacing Docker Desktop with minikube

I want to make my testcontainers in Java integration tests work with minikube replacing Docker Desktop.
I followed below article to get started:
https://www.atomicjar.com/2021/10/docker-on-windows-and-macos/#minikube
This is what I've got in testcontainers.properties
docker.client.strategy=org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
docker.host=tcp\://192.168.64.2\:2376
docker.cert.path=/Users/username/.minikube/certs
docker.tls.verify=true
Although my docker is up and running, I'm getting following exception:
Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
Can anybody please suggest anything to make it working?
TA
If you are using gradle try -no-daemon flag to use a new daemon. Your old gradle daemon still using your previous testcontainers properties, also restart your IDE if you're running your build inside.
After restarting Minikube and Intellij editor, and updating testcontainer-bom to be the latest - from 1.15 to 1.16.2, I was able to pull some third-party docker images. This means docker is working now.
However, I'm still trying to find a way to work with local images (Other application docker images) for integration testing as it used to work with Docker Desktop.

How can I clone my Google Cloud Instance so I can download it and host it locally using Docker [duplicate]

I have a Google Cloud VM that installed with my application. The installation step is completed and I:
Turned off the VM instance.
Exported the disk to disk image called MY_CUSTOM_IMAGE_1
My wish now is to use MY_CUSTOM_IMAGE_1 as the starting image of my docker image build. For building the images I'm using Google Cloud Build.
My docker file should look like this:
FROM MY_CUSTOM_IMAGE_1 AS BUILD_ENV
...
When I tried to use this image I got the build error:
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
ERROR
pull access denied for MY_CUSTOM_IMAGE_1, repository does not exist or may require 'docker login'
Step 1/43 : FROM MY_CUSTOM_IMAGE_1 AS BUILD_ENV
The reason is that VM images are not the same as Docker images.
Is this possible to make this transform (GCP VM Image -> Docker image), without external tools (outside GCP, like "docker private repositories")?
Thanks!
If you know all the installed things on your VM (and all the commands), do the same thing in a Dokerfile. Use as base image, the same OS version as your current VM. Perform some tests and it should be quickly equivalent.
If you have statefull files in your VM application, it's a little bit more complex, you have to mount a disk in your container and to update your application's configuration to write in the correct mounted folder. It's more "complex" but there is tons of example on internet!
No, this is not possible without a tool to extract your application out of the virtual machine image and recreate in a container. To the best of my knowledge, there is no general-purpose tool that exists.
There is a big difference between a container image and a virtual machine image. Container images do not have an operating system, virtual machine images are a complete operating system and device data. The two conceptually are similar, but extremely different in how they are implemented at the software and hardware level.

Google Cloud VM Image to docker image

I have a Google Cloud VM that installed with my application. The installation step is completed and I:
Turned off the VM instance.
Exported the disk to disk image called MY_CUSTOM_IMAGE_1
My wish now is to use MY_CUSTOM_IMAGE_1 as the starting image of my docker image build. For building the images I'm using Google Cloud Build.
My docker file should look like this:
FROM MY_CUSTOM_IMAGE_1 AS BUILD_ENV
...
When I tried to use this image I got the build error:
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
ERROR
pull access denied for MY_CUSTOM_IMAGE_1, repository does not exist or may require 'docker login'
Step 1/43 : FROM MY_CUSTOM_IMAGE_1 AS BUILD_ENV
The reason is that VM images are not the same as Docker images.
Is this possible to make this transform (GCP VM Image -> Docker image), without external tools (outside GCP, like "docker private repositories")?
Thanks!
If you know all the installed things on your VM (and all the commands), do the same thing in a Dokerfile. Use as base image, the same OS version as your current VM. Perform some tests and it should be quickly equivalent.
If you have statefull files in your VM application, it's a little bit more complex, you have to mount a disk in your container and to update your application's configuration to write in the correct mounted folder. It's more "complex" but there is tons of example on internet!
No, this is not possible without a tool to extract your application out of the virtual machine image and recreate in a container. To the best of my knowledge, there is no general-purpose tool that exists.
There is a big difference between a container image and a virtual machine image. Container images do not have an operating system, virtual machine images are a complete operating system and device data. The two conceptually are similar, but extremely different in how they are implemented at the software and hardware level.

docker images are not showing in console but showing in docker hub (allow permission by someone)

I am pretty new in docker, The thing is this i have created an account to the DockerHub, then someone give me the permission to his/her private repository, i have also configure docker on my local Machine Ubuntu.
The docker images are showing on the DockerHub, as i am login through the shell also, but whenever i am try to list those images on my local machine not show any of them. i don't know at which point i am wrong. or what important point i am missing
docker image ls or docker image ls -a
Viewing private images is not supported directly from the command line according to this thread which is a little old but still no native support for your case and that's why you will notice that there are custom projects like this, the project mentioned in the following comment which can help you achieve what you need.

Can't find a good docker image for windows version 14393

I am trying to setup a docker image for an mvc5 website to deploy to my service fabric Windows server 2016 with containers based cluster.
It seems that every image with IIS configured is based on a different windows build than 14393, and when I deploy those to service fabric they fail to start on my windows servers.
Am I missing something here? Does it matter what server the dockerfile runs on? So far is seems impossible to get a simple site up and running in a docker container on my service fabric cluster. I spent over a day with microsoft/windowsservercore and it just won't work, and there seems to be no way to enable failed request tracing on it because attempting to install Web-Server with all submodules fails.
If you go to docker registry, find the image, and navigate to the TAGS tab, you can find all image versions and the respective build.
For ASPNET MVC, the image microsoft/aspnet with tag 4.7.1-windowsservercore-10.0.14393.1884 is probably the one you need.
For IIS image, the image microsoft/iis with tag windowsservercore-10.0.14393.1944 might be suitable for you, you might have to add the missing packages for your application.
The problem is likely you trying to use the latest image, that won't be compatible. In your docker image, when you create the docker file,
Instead of using FROM microsoft/aspnet
you should use FROM microsoft/aspnet:4.7.1-windowsservercore-10.0.14393.1884
with the image tag after the name, otherwise you will use the latest version, that is not always compatible and should be avoided

Resources