Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Fix grafana startup in docker-compose (ledgerwatch#4677)
Browse files Browse the repository at this point in the history
* grafana user 472:0

* Fix typo extra ~ in Makefile

* Create grafana dir correctly

* chown -R
  • Loading branch information
stoooops committed Jul 8, 2022
1 parent e13a318 commit 9f5b401
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ ifdef XDG_DATA_HOME
endif
xdg_data_home_subdirs = $(xdg_data_home)/erigon $(xdg_data_home)/erigon-grafana $(xdg_data_home)/erigon-prometheus

docker-compose: validate_docker_build_args
setup_xdg_data_home:
mkdir -p $(xdg_data_home_subdirs)
ls -aln $(xdg_data_home) | grep -E "472*0*erigon-grafana" || sudo chown -R 472:0 $(xdg_data_home)/erigon-grafana
@echo "✔️ xdg_data_home setup"
@ls -al $(xdg_data_home)

docker-compose: validate_docker_build_args setup_xdg_data_home
docker-compose up

# debug build allows see C stack traces, run it with GOTRACEBACK=crash. You don't need debug build for C pit for profiling. To profile C code use SETCGOTRCKEBACK=1
Expand Down Expand Up @@ -196,7 +201,7 @@ endif
ifdef DOCKER
sudo usermod -aG docker $(ERIGON_USER)
endif
sudo -u $(ERIGON_USER) mkdir -p ~$(ERIGON_USER_XDG_DATA_HOME)
sudo -u $(ERIGON_USER) mkdir -p $(ERIGON_USER_XDG_DATA_HOME)

# create "erigon" user
user_macos:
Expand All @@ -206,4 +211,4 @@ user_macos:
sudo dscl . -create /Users/$(ERIGON_USER) PrimaryGroupID $(ERIGON_USER_GID)
sudo dscl . -create /Users/$(ERIGON_USER) NFSHomeDirectory /Users/$(ERIGON_USER)
sudo dscl . -append /Groups/admin GroupMembership $(ERIGON_USER)
sudo -u $(ERIGON_USER) mkdir -p ~$(ERIGON_USER_XDG_DATA_HOME)
sudo -u $(ERIGON_USER) mkdir -p $(ERIGON_USER_XDG_DATA_HOME)
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ services:

grafana:
image: grafana/grafana:9.0.2
user: ${DOCKER_UID}:${DOCKER_GID} # Uses erigon user from Dockerfile
user: "472:0" # required for grafana version >= 7.3
ports: [ "3000:3000" ]
volumes:
- ${ERIGON_GRAFANA_CONFIG:-./cmd/prometheus/grafana.ini}:/etc/grafana/grafana.ini
Expand Down

0 comments on commit 9f5b401

Please sign in to comment.