At present, I use Docker to do CaaS platform, mainly to solve:
1, operation and maintenance of sandbox environmental testing;
2, research and development of semi-automated code deployment and rollback;
3, clustered application and auto scale.
The 3 points are now fulfilled, but there is a problem when contacting the 2nd and 3rd. In the 2nd, the development test successful code will be packaged as a images, put into a private library, and then the 3rd cluster update, will choose this successful version of the image, but in the update, because each node needs to get the mirror from the private library, so that the more nodes update the more slowly, so in order to solve this problem, I am here in the second step after the development of packaging image, will be carried out all the node push, so when the cluster update, it will be very fast.
Here is the procedure for me to automatically package the code as a mirrored and mirrored full-node push.
1, the code is automatically packaged as a mirror
The main point is to run the following command in the host where the container resides.
Docker commit--pause=false Container_name image_name:image_tag &>>/dev/null && Docker push Image_ Repo/image_name:image_tag &>>/dev/null && echo 0 | | Echo 1
Above is just the operation of the command, the implementation of the operation I have in the program is encapsulated.
Here's what's happening in the Web platform
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/C1/wKioL1XtAofBndrVAAGjgOPROq4159.jpg "title=" 11.png "alt=" Wkiol1xtaofbndrvaagjgoproq4159.jpg "/>
I want to package the container test_update for mirroring, then click the Compress button to enter a specific description.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/C1/wKioL1XtA73zzq6SAACwAyg-YHA028.jpg "title=" 11.png "alt=" Wkiol1xta73zzq6saacwayg-yha028.jpg "/>
Then choose OK, and then you'll be there.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/C1/wKioL1XtBBORtv1IAALscW8OnU8447.jpg "title=" 11.png "alt=" wkiol1xtbbortv1iaalscw8onu8447.jpg "/> can see a dialog box to the right, showing that the container is packaged for mirroring success.
Then go to container management to see the details.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/C5/wKiom1XtAkCQicZrAAGnnHktexg252.jpg "title=" 11.png "alt=" Wkiom1xtakcqiczraagnnhktexg252.jpg "/>
You can see that the image is already there, and see the details via the info button
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/C1/wKioL1XtBJHB9bv4AAGzC8DXpHk182.jpg "title=" 11.png "alt=" Wkiol1xtbjhb9bv4aagzc8dxphk182.jpg "/>
You can see the details as they were packaged earlier.
2. Push the image to all nodes
Also in image management, select the push button
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/C5/wKiom1XtArWB9NxBAAGKDNzC6Fk018.jpg "title=" 11.png "alt=" Wkiom1xtarwb9nxbaagkdnzc6fk018.jpg "/>
Selecting push will synchronize the image information across all nodes, which is actually running the Docker pull command on all nodes
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/C5/wKiom1XtAxyAdGLzAAOAFJNlrrc459.jpg "title=" 11.png "alt=" wkiom1xtaxyadglzaaoafjnlrrc459.jpg "/> can be seen through the lower left corner of the Firebug see through 18.18 seconds in all nodes to 361m mirror synchronization completed.
This can then be used by a clustered environment or other environment.
This article is from the "Yin-Technical Exchange" blog, please be sure to keep this source http://dl528888.blog.51cto.com/2382721/1692224
Image packaging and node push for Docker advanced applications