Reputation: 1445
Question 1: Do I have to update both the container and the image, or just the image?
Question 2:
When I make changes to the data in which the my app uses, how can I update the docker image or container(if necessary), so that the app will show and update data from updated image/container.
I have the current docker image running named: test/app1
Here are my current steps:
_1. Rebuild the application using: docker build -t test/app1
_2.Restart Docker using: service docker restart
**After these steps are made there are no errors but the image does not have the updated data. Is this an issue with the Image update or Container.
Thanks.
Upvotes: 1
Views: 306
Reputation: 39527
First of all you do'nt have to restart docker
service!
To answer your first question:
Question 1: Do I have to update both the container and the image, or just the image?
Just update the image, stop old container, docker run
new container from new image.
Question 2: When I make changes to the data in which the my app uses, how can I update the docker image or container(if necessary), so that the app will show and update data from updated image/container. I have the current docker image running named: test/app1
Depends on your app data, If its mounted via bind mount, or volume, your just have to update these, If your app requires restart some service to make that data available, you can stop/start the container or remove/recreate it.
If your data is in the image/container, You update the image, stop the old container and recreate it using the new image.
Upvotes: 2