Save a Modified Docker Container As An Image Using Commit
2 min read

Modify container

1. Download / Create

Download or create the container you want to use as your base.

2. Modify

Make the changes you want to do to it. It can be anything from adding files to updating software, etc.

3. Commit

The most important part, committing your changes to a new Docker image.

docker commit <name-of-container> <username>/<new-image-name>:<tag>

For example, it might look something like this.

docker commit my-container banjoanton/my-image:latest

4. Push

If you want to push your work to Docker Hub, you can do it like this.

docker push <username>/<new-image-name>

Which, in my case, would look like this.

docker push banjoanton/my-image