Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a Docker image from a manifest

Tags:

docker

I got this manifest.json and all layers needed to build a Docker image, it looks like this:

enter image description here

How can I actually build and push this image to my local registry? With docker import I can import all the individual layer.tar files but that doesn't help me a whole lot. I also looked into the experimental docker manifest push but I can't figure out what a MANIFEST_LIST is in the limited documentation.

edit: I already added all the layers individually, here they are: enter image description here

like image 718
NickDK Avatar asked Apr 27 '18 07:04

NickDK


People also ask

How do I create a docker image from an existing image?

You can create a new image by using docker command $docker build -f docker_filename . , It will first read the Dockerfile where the instructions are written and automatically build the image. The instruction in the Dockerfile contains the necessary commands to assemble an image.

What is a docker image manifest?

A manifest list is a list of image layers that is created by specifying one or more (ideally more than one) image names. It can then be used in the same way as an image name in docker pull and docker run commands, for example.

Can Containerd build docker images?

You cannot use containerd to build container images. Linux images with containerd include the Docker binary so that you can use Docker to build and push images. However, we don't recommend using individual containers and local nodes to run commands to build images.


1 Answers

After we run a image, we actually also create a container. and we can commit this container as a new image:

commit -a='frank' -m='new image' cbd18c36d22c 192.168.0.123:5000/frank/hello

And here, you have already create some image, just forgot to name it. but you can also given a tag .(Assume you have locate registry with 192.168.0.123:5000 address)

docker tag cbd18c36d22c 192.168.0.123:5000/frank/hello

And then you should list you commit by docker images.

192.168.0.123:5000/frank/hello   latest              cbd18c36d22c        2 weeks ago         349MB

To let the docker daemon know where to pull your images, you have to config it (Seems you are run docker on Mac). you can Client the Preference -->Daemon -->Basic and then input your 192.168.0.123:5000 into the insecure registries.

Finally, restart the docker daemon by click the Apply & restart.

like image 109
Frank AK Avatar answered Sep 22 '22 08:09

Frank AK