Docker official images vs custom images - image

I am trying to figure out the importance of custom images. Do you have to create and use custom images for your environment, or you can get all the images you need from Docker official images?
Thanks,

At the moment I am using both - a custom image made by me and a ready image from the docker hub. I am using the custom image for my web application and for the database I can easily use an image of postgresql or mysql and just link them both using a docker-compose.yml. So to answer your question, you will normally end up using both.

Related

How can I push docker compose based images for Gitlab Registry Using CI/CD

I've linked Postgres DB & API images using docker-compose, its working in local, I've to push both image for gitlab registry Using CI/CD.
enter image description here
The gitlab docs cover how to build and push Docker images during CI quite well.
It is important to note/use the CI_REGISTRY_IMAGE variable. If the image name you try to push is different from CI_REGISTRY_IMAGE, the push will fail. If you want to have multiple images, you either need to label them in the tag ($CI_REGISTRY_IMAGE:db-$CI_COMMIT_REF_SLUG) or create a separate repo and manage the images there.

Got Stuck In Deploying Laravel App With Vue Js?

we are trying to deploy laravel app(which contains api's) and vue js app(contains full front end).both are in seperate folders how to deploy through bitbucket pipeline.
The best work around is for you to have a laravel image and docker image separately. You can then push the images to docker hub and create containers on the server using the latest images. You can also consider using watchtower to help in updating you containers everytime we have a new images available in dockerhub.

How to save a compute engine VM-instance setup in Google Cloud Platform?

I have created a compute engine VM-instance in Google Cloud Platform. Then I have installed go using the standard procedure downloading it from https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz. Everything worked properly and I was able to run go application. However, after closing the instance when I reopened it, it says go is not installed. The message is following.
-bash: go: command not found
How can I save the instance setup?
Creating, Deleting, and Deprecating Custom Images
You can create custom images of boot disks and use these images to create new instances. This is ideal for situations where you have created and modified a persistent boot disk to a certain state and need to save that state to create new instances.
I think you should also consider using Docker containers.
Pushing and pulling images
Container-optimized VM images

how to deploy multiple virtual machines using custom image?

I am using a Azure.
I created a custom image of Linux virtual machine.
I have to create multiple virtual machines of a custom image.
BUT I don't know the way to do.
In Resource manager portal, 'virtual machine scale out' function is only for OS images (not for custom images).
I prefer a solution done in the portal though, using Azure CLI or using template is okay to me.
There is an azure-quickstart-template named 201-vmss-windows-customimage that will give you a template to achieve your scenario.
From the readme.md
The template allows a URL to a custom image to be provided as a
parameter at run time. The custom image should be contained in a
storage account which is in the same location as the VM Scale Set is
created in, in addtion the storage account which contains the image
should also be under the same subscription that the scale set is being
created in.
Update: If your custom image is based on Linux, you need modify osType in this template. Modify it to Linux and save it as name test.json. You could execute following cmdlet.
New-AzureRmResourceGroupDeployment -Name ExampleDeployment -ResourceGroupName mygroup -TemplateFile C:\Users\shui\Desktop\test.json
This is my test in my lab.
Also, you could use this Deployment template for autoscaled custom image vmss
This template allows you to deploy an autoscaled VM Scale Set of Linux
VMs based of an existing custom image. The load balancers and vms
should be assigned public IPs

Where can I create images from? Locally at all? (Docker remote API)

May/may not be an easy question here, but where can I pull images from to create a new docker image via the API?
Documentation
My (unsuccessful) attempts have been trying to build an image from something local. Using docker images to get a list of images, then trying to use their Image ID or Repository has not worked for me while using the fromImage query param like so:
curl --data '' host:port/images/create?fromImage=test/hello-world&tag=webTesting
I consistently get the following error:
{"errorDetail":{"message":"Error: image test/hello-world not found"},"error":"Error: image test/hello-world not found"}
In running docker images, we can very clearly see the following:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
test/hello-world latest 6d9bd5e6da4e 2 days ago 556.9 MB
In all combinations of using the repository/tag/id the error still displays. I understand that we can create images from urls with fromSrc, and there are alternative create image routes by uploading .tar files, but is it possible in the case to create an image from one that already exists locally? I've had success in compiling images from ubuntu or centos, but I'm looking basically to replicate something local with new tags/repository.
I do see in the documentation that fromImage parameter may only be used when pulling an image -- does this mean we can only import images that are hosted on Dockerhub?
As you noted, the Docker remote API documentation clearly states that a pull operation must be triggered for this image reference.
This does not require that you use DockerHub, but it means that the image must be located on a registry and not simply in your daemon's local cache. If you were running a Docker registry instance on your host (which is easily done with the public registry image in DockerHub) on port 5000, then you could use "localhost:5000/test/hello-world" as the fromImage, and it will pull it from your locally hosted registry (after you push it locally of course).

Resources