B
B
beduin012018-03-28 11:15:47
Docker
beduin01, 2018-03-28 11:15:47

How to properly prepare a docker image for deployment?

Suppose I wrote an application, built a docker file, checked that everything works through docker run.
How to be further? (we are just starting to implement docker and there is no established practice).
1. I push the microservice into the docker file repository, which is used to build the docker image?
2. what about the config? where and in what form to put it, so that later you can connect to it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
al_gon, 2018-03-28
@al_gon

1) yes
2) use volumes

A
abroabr, 2018-03-28
@abroabr

Use ready-made microservice management systems.
For if you really have micro, then there will be a lot of them and you will get bored manually.
One of the most versatile solutions is Kubernetes.
Two good articles on how to actually prepare an application for this matter are here:
https://habrahabr.ru/users/len/posts/
You can also find a video on the link there.
What language does not matter. The main thing is the principles. In particular, pay attention to Helm in these articles from Elena.
If the versatility of Kubernetes is too much for you, then I recommend the developed system for simple configurations Flynn.io. Everything is there - both deployment and monitoring and GUI and documentation.
Cutting it all down by hand is a lot of work. Better not.
But if you decide on your own, then I recommend using nomad and consul and vault - utilities for building your own cloud. The documentation on their website and on Habré is full of articles.
To deploy a system from many Docker containers on a developer's machine, then docker-compose is just that. This is so convenient that many people drag docker-compose into production incorrectly. But you can't do that. However, for development - very convenient.

S
scor2k, 2018-04-05
@scor2k

If you are just starting out, look towards docker-compose. Again - the presence of .env files with the possibility of inheritance will allow you to run your services on different environments (test, prod), and if you decide to use service discovery (it's better to decide right away, then it will be difficult to move) - then some of the configs will be dynamic.
PS From Kubernetes you will have an explosion of the brain at the start (IMHO), and from docker-compose to swarm you can walk if necessary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question