简体   繁体   中英

How to save Docker image writable

I found out that docker image is read-only. Is there a way to save the image writable?

The reason why I post this question is because I want to modify the original image. Delete or Update from the base image inside container.

When you build an image it is immutable but if you want to modify something from an other image you can create a Dockerfile from an image that you want to modify with FROM command.

With RUN, COPY and other commands you can create your personal image.

What kind of changes do you want to do?

When working with Docker images and containers, one of the basic features is committing changes to a Docker image. When you commit to changes, you essentially create a new image with an additional layer that modifies the base image layer.

Create a new image by committing the changes using the following syntax:

sudo docker commit [CONTAINER_ID] [new_image_name]

I hope this answer help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM