Eight Docker container development models---The Shared Volume Dev Container

Source: Internet
Author: User

The Shared Volume Dev Container 
All my dev containers share at least one volume with the host:/home, which is for easy development. For many apps, in development mode, use File-system-change-based Code-reloader to run, so that the container
It encapsulates os/distro-level dependencies and helps validate app-as-bundled work in the initial environment without having to restart/rebuild VMS every time the code changes. 
As for the other, I just need to reboot (not rebuild) the container to respond to the code changes. 
For test/staging and production containers, in most cases, instead of volume shared code, use "Add" to add code to the Docker container. 
This is the dockerfile of my "homepage" Dev container, for example, including my personal wiki, which exists in the "devbase" container under/home, and the following shows how to use the shared base container and/home volume: 
From Vidarh/devbase 
Workdir/home/vidarh/src/repos/homepage entrypoint bin/homepage Web 
The following is Dev-version's blog: 
From Vidarh/devbase
Workdir/user Root
# for GRAPHIVZ integration RUN apt-get Update 
RUN apt-get-y Install Graphviz xsltproc ImageMagick
USER Vidarh 
Workdir/home/vidarh/src/repos/hokstad-com 
entrypoint bundle EXEC rackup-p 8080 
Because they fetch code from a shared library and are based on a shared base container, these containers are often rebuilt very quickly when I add/modify/delete dependencies. 
Even so there are some places where I am very willing to improve, although the above base is lightweight, most of them are still unused in these containers. Since Docker uses Copy-on-write overlay, this does not result in a huge overhead, but it still means that I do not have the minimum resource consumption, or the chance to minimize attack or error.

Eight Docker container development models---The Shared Volume Dev Container

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.