What is the difference between Docker's migration and using Dockerfile?
Beginner Docker, there are a few questions:
- Use dockerfile build out of the container, and use the save / load mirror run out of the container will be the same?
- Dockerfile which contains some of the script behavior (such as start some background services, etc.), in the static mirror is what kind of situation? In other words, I put this image after migration, will save these script behavior?
2015-01-22 add comment share it
- Docker-compose how to specify the directory, similar to the dockerfinle WORKDIR instruction
- What is the difference between the dockerfile's CMD and ENTRYPOINT commands? ?
- Docker container time synchronization problem?
- If you enter the Docker image of the bash environment?
- Docker env variable in the run how to replace?
- Failed to fetch when creating docker image update system?
- Micro letter
Did not find the relevant results
Vikings – keen on the non – professional Dev of research
Agree from: Tian Haohao
1. Will the dockerfile build out of the container, and use the save / load mirror run out of the container will be the same?
Case 1: assume that the image build did not run after, then through the save only the image of all the data layer into a binary tar file. After the import through the load, and before the build image compared to no difference, so the same.
Case 2: Assuming that the image has been run but not commit (if commit, it will be a new image), then through the save is still the image of the data layer into a binary tar file, and the container produced by the new data layer Will not be exported. So after the import load, and is in the run state of the container compared to the data inconsistent (the lack of run after the data layer).
2.Dockerfile which contains some of the script behavior (such as start some background services, etc.), in the static mirror is what kind of situation? In other words, I put this image after migration, will save these script behavior?
Suppose you set the script behavior is set by the dockerfile cmd, then:
The script behavior set in Dockerfile is stored in the data layer of the graph directory. These are equivalent to the metadata of the image runtime.
If there is a migration, then there is a need to distinguish how it is migrated. If you simply use save / load, then the new image will still be executed.
If the container is commit to generate a new image to migrate, then the old image set the script will be invalid.