docker compose 로 GitLab 구동시 로그 파일이 용량을 많이 차지하는 문제 해결
Problem - huge logs
# df -h / Filesystem Size Used Avail Use% Mounted on /dev/sda1 97G 97G 0 100% / # docker ps -a CONTAINER ID IMAGE fb28....... gitlab/gitlab-ce:16... # du -h --max-depth=1 /var/lib/docker 58G /var/lib/docker/volumes 6.2G /var/lib/docker/overlay2 33G /var/lib/docker/containers 97G /var/lib/docker ... # ls -alh /var/lib/docker/containers/fb28*/*.log 33G fb2...-json.log # du -h --max-depth=1 \ /var/lib/docker/volumes/gitlab_data/_data 13M ./git-data 104M ./gitaly 57G ./prometheus 279M ./postgresql ...
Limit docker log
/etc/docker/daemon.json
{ "log-driver": "json-file", "log-opts": { "max-size": "100m", "max-file": "10" } }
Disable prometheus
docker-compose.yml
services: app: image: gitlab/gitlab-ce:16.6.7-ce.0 container_name: gitlab_app restart: always hostname: '...' environment: GITLAB_OMNIBUS_CONFIG: | prometheus_monitoring['enable'] = false ...