Docker images for packaging applications

Apparently there are apparently two practices for packaging and deploying applications

  • create docker image and expand it
  • create and deploy an application from scratch.

I am confused as to how to use option 1). The premise is that you take the docker image and reuse it on any platform. But how is this a viable solution in practice, since the environment often has platform and application-specific configurations? The docker image from my test environment cannot be deployed to production as it contains mocks and test layer configurations.

+3


source to share


1 answer


The idea behind packaging the app as Docker images is that all external / system configurations are built into the app. ie: any specific version of an external engine like java or ruby; basic GNU / Linux software that you have on your system (no more different versions of awk or grep), etc.

From my point of view, it is possible to have some small differences between the development and production sample, but these differences should be minor configuration parameters such as the log level or the like. The advantage of using a container in your application distribution system is to avoid all the problems associated with external differences, as well as a new approach to the problem of "web size architecture" and elastic platforms, having a new standard way of deploying them. Having some external services. mocking your test / development system shouldn't be a problem, or if so I think the problem is with the layout. The layout should be embedded in your application container, but you can use them like another image (or if possible,avoid bullying the service and use it as a container).



Edit 1: As a general approach, if you are using Docker as a tool to help with continuous integration or production deployment, I would not recommend having different containers for development and production. If you have experience with IT automation tools like Puppet, Chef, Ansible, or Salt, this is an easy and probably quick way to set up your containers (and some of them, like a chef, have a docker-specific approach, chef -container which has some advantages here) and is a good option to consider if you're building your infrastructure with them. But if you are building / developing a new architecture based on Docker, I would check other options, more decentralized and containerized like Consul or etcd, for config and data template management, service discovery,flexible deployment with orchestra ...

+1


source







All Articles