rmshell
https://docs.docker.com/compose/env-file/
rmshell
https://docs.docker.com/compose/environment-variables/
George
короче, тебе anisble зайдет
Ruslan
я в курсе
George
тебе все равно хосты как-то наливать
Ruslan
и .env и ansible, вопрос про сервис
Donald
Почему официальный образ эфира пущает сервис от рута? https://github.com/ethereum/go-ethereum/blob/master/Dockerfile
Donald
а что, в докере USER отменили на пару с gosu?
Ruslan
хипстеры про это не в курсе
Donald
лул
Ruslan
ни понимайт
https://docs.docker.com/compose/extends/#different-environments
Donald
блин, там еще и VOLUME не определен. Типа синхронизировал ноду месяц, потом обновил контейнер - синкай снова
Ruslan
неплохой и достаточно простой вариант
George
https://docs.docker.com/compose/extends/#different-environments
ну, ты можешь docker-compose -f 1.yaml -f 2.yaml - вот так делать
George
или класть рядом docker-compose.override.yaml
George
но это изврат, кмк
Ruslan
или класть рядом docker-compose.override.yaml
вот, этот вариант мне нравится, пусть девопс хоть через ansible подкладывает override файл и затем ставит пакеты, всё взлетит гарантированно
Vladimir
Hi friends! Tell me please how to use --log-opt compress in docker-compose.yml? Any experience with it welcome
Vladimir
also another question: do you manage log-rotation for json-file log driver? I need it not only with setting max-file/max-size, but max days
George
I am not sure that default driver (i.e. json-file) allow compression of log files
Vladimir
Hello! What docker driver are you using?
you can write russian, i just don't have russian layout here unfortunately. It's json-file log driver
George
I recommend using journald driver because it allows using of 'docker logs' command and automagically rotates and shrinks logs
George
also another question: do you manage log-rotation for json-file log driver? I need it not only with setting max-file/max-size, but max days
You are going to use logrotate standalone utility, but it is .... difficult to configure correctly.
Vladimir
automagically sounds good, but i afraid magically loose logs with using journald... what if journald is down? I want independent mechanism to have logs from docker containers on host
George
Or you may install also syslog or something like filebeat for capturing logs and then you can make ANYTHING you want with them
George
> what if journald is down? It can't be down because it is essential system component. And if it accidentally occured you have MUCH MUCH greater issue than just logs of docker containers
Vladimir
My idea was to use fluent bit that will go to var/lib/docker/container location and process log file there.
George
so you will configure fluentd to rotate logs 😊
Vladimir
but log rotation of it still big question..
George
If you read logs by fluentd, you SHALL NOT rotate them with docker/logrotate
Donald
oh yeah, log rotation is an issue here, in 2k19
George
XXI century lel
Donald
modern problems, still no solutions
George
we are going to conquer space and can't manage with log rotation 🤦‍♂️🤦‍♂️🤦‍♂️
George
but log rotation of it still big question..
Tell me please if your question is answered or you need more details
Anonymous
работаю через docker-compose, мне нужно из контейнера обращасться на сервис хоста на некотором порту на разных осях получаются разные конфиги - получилось под убунтой прописать http://172.17.0.1:3000 - под маком http://host.docker.internal:3000 есть ли какое то нормально гарантированное решение получить адрес хоста? есть ли возможность вставить в конфиг сервиса, который я подключаю через volume что-то из env переменных?
George
> есть ли возможность вставить в конфиг сервиса, который я подключаю через volume что-то из env переменных?
George
есть
George
docker-compose -e blablabla=$(....) up
George
и в -e чего-то засунуть, что будет зависеть от конкретной тачки
George
либо действительно формировать .env в зависимости от машины
George
docker-compose -e blablabla=$(....) up
это не точно - а скорее как идея
Anonymous
нет, гарантированного нет
серьезно? а почему так, вроде бы очень частая задача
George
потому что докер компоуз только для локальной разработки
George
и если тебе надо что-то проксировать с хоста... то ты что-то делаешь не так
Anonymous
и если тебе надо что-то проксировать с хоста... то ты что-то делаешь не так
либо всё суй в докер, либо иди лесом... так что ли? а зачем тогда этот костыль "host.docker.internal"?
George
логики у докера нет
Vladimir
Tell me please if your question is answered or you need more details
I see that log-opt compress doesn't work for docker-compose.yml
Ali
Все, больше не нужна мне ваша помощь, хрен дождешься :( хотя походу никто и не знает толком как создать на винде магию.. сам сделал так, что бы на Windows работало как на linux великий докер. Правда потратил почти месяц, но за то любой проект подымаю, postgress на изи, даже не нужно дописывать различные опции что бы понимал. Не нужны всякие прослойки вроде "docker for windows" и т.п.
Petr
https://avatars.mds.yandex.net/get-zen_doc/1708203/pub_5d9cba2a43fdc000ad771e90_5d9cbacd06cc4600b1241617/scale_1200
Ali
postgres
PostgreSQL.
Ali
👌
Donald
как правильно сделать докер-образ с pip-зависимосями, которые надо нудно собирать? GCC тащить в результат не хочется. копировать чохом из build-образа /usr/local/lib/python3.5/dist-packages?
Donald
да это понятно, непонятно, что копировать
Gleb
так ты пип упаковать можешь
George
I see that log-opt compress doesn't work for docker-compose.yml
There is no difference between log-opts for docker-compose and for "simple" docker run
Donald
так ты пип упаковать можешь
https://pythonspeed.com/articles/multi-stage-docker-python/ подкинули вот доку, вдруг кому пригодится
Donald
чому?
George
Лучше собирай вил. Его в артефакты. Потом в локальный pypi
Vladimir
There is no difference between log-opts for docker-compose and for "simple" docker run
I thought so, but when you try this simple example logging: driver: "json-file" options: max-size: "1m" max-file: "10" compress: "true"
Vladimir
it returns: Cannot create container for service blabla: unknown log opt 'compress' for json-file log driver
George
and docker-compose file format?
George
ok, you may define global settings via /etc/docker/daemon.json ;)
Vladimir
docker-compose v1.24.1