How to create an image from a running container in Portainer

Subscribe us on Google News
Shares


Jack Wallen shows you how easy it is to create an image from a running container and then deploy a container based on that new image, all from Portainer’s easy-to-use management platform.

Image: Pichsakul/Adobe Stock

Portainer has very quickly become my favorite Docker container management system. With this platform, there are few things you cannot do, such as deploying containers and creating and managing networks, volumes, secrets and full applications.

Another neat trick that Portainer has up its sleeve is the ability to create new images based on running containers. This is a handy feature if you are deploying a custom container and want to be able to replicate that container quickly and repeatedly. It can save a lot of time and effort for your Docker deployments.

I want to show you how easy it is to use Portainer to create a new image, based on a running container. One thing to keep in mind is that new images will be saved to the local repository. Even if you connect Portainer to your Docker Hub registry, creating these images doesn’t push them to Docker Hub (I’m working on trying to find a fix for this). However, you can add users to Portainer so that your entire team has access to the images and containers there.

That said, let’s create an image.

SEE: Recruitment kit: Back-end developer (TechRepublic Premium)

What you will need


To follow this tutorial you will need a running instance of Portainer and that’s it. If you haven’t deployed Portainer yet, you can find out how in “How to deploy the Portainer container management tool with persistent storage”. Let’s get to work.

Also, Read   Space tourist reveals 'unusual formation' for ISS mission

How to create a new image from a running container

Batch in Portainer, then click Containers in the left sidebar. In the resulting window (Figure A), click the name of the container from which you want to create the new image.

Figure A

portimagea
Image: Jack Wallen/TechRepublic. I have already deployed a few containers with Portainer.

In the resulting window, scroll down to the Create Image section (Figure B).

Figure B

portimageb
Image: Jack Wallen/TechRepublic. Creating a new image from a running container is easy with Portainer.

You must give the image a name. If you don’t specify a tag, the last one will be used. Let’s give our image the name and tag myimage:may18. Type that in the Image field, then click Create. This will create a new image, based on the chosen container.

How to locate your new image

Click Images in the left sidebar. You should see the image listed which is labeled myimage:may18(Figure C).

Figure C

portimagec
Image: Jack Wallen/TechRepublic. Our newly created image is ready to go.

Click on the name of this image to view full details (Figure D).

Figure D

pictured
Image: Jack Wallen/TechRepublic. The details of our newly created image.

How to deploy a container based on our new image

Now it’s time to create an image with our container. Click Containers in the left sidebar, then click Add Container. In the resulting window (Figure E), give the new container a name, then type myimage:may18 in the image field.

Figure E


portimagee
Image: Jack Wallen/TechRepublic. Creation of a new container, based on our new image.

Since we’re just creating a simple deployment, that’s all we need to add for configuration. Click Deploy Container and Portainer will do its thing. You should quickly be returned to the container list, where you will see our new container running.

You have successfully created an image from a running container and then deployed a new container based on that image. Isn’t technology fun?

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech tips for professionals from Jack Wallen.



Source

Also, Read   Vivo launches budget smartphones Y10 and Y10 t1
What’s your Reaction?
+1
+1
+1
+1
+1
+1
+1
Shares

Leave a Reply

Your email address will not be published.

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
CHP Adblock Detector Plugin | Codehelppro