From cdd29e5b310a97cf5d24926025dd3968c909167f Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Mon, 22 Apr 2024 15:14:19 +0200 Subject: [PATCH 1/5] chore: added docker support for osx --- docker/docker-compose.local_dev.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docker/docker-compose.local_dev.yml b/docker/docker-compose.local_dev.yml index 0a3f10cd0695..0b257d2f5971 100644 --- a/docker/docker-compose.local_dev.yml +++ b/docker/docker-compose.local_dev.yml @@ -1,5 +1,3 @@ -version: "3.4" - # Configuration to work with a local non-dockerized Lodestar node # For local testing and quick debugging # @@ -12,26 +10,28 @@ services: build: context: prometheus environment: - # Linux: http://localhost:8008 - # MacOSX: http://host.docker.internal:8008 - BEACON_URL: localhost:8008 - VC_URL: localhost:5064 + BEACON_URL: http://host.docker.internal:8008 + VC_URL: http://host.docker.internal:5064 restart: always - network_mode: host volumes: - "prometheus:/prometheus" + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "9090:9090" grafana: build: grafana_dev restart: always - network_mode: host volumes: - "grafana:/var/lib/grafana" - "grafana-dashboards:/dashboards" environment: - # Linux: http://localhost:9090 - # MacOSX: http://host.docker.internal:9090 - PROMETHEUS_URL: http://localhost:9090 + PROMETHEUS_URL: http://host.docker.internal:9090 + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "3000:3000" volumes: prometheus: From da6ec66d3942fa1fc11ccfa0ea0964f8604e9054 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Mon, 29 Apr 2024 22:33:12 +0200 Subject: [PATCH 2/5] chore: address comments --- docker/docker-compose.local.yml | 20 +++++++++++--------- docker/docker-compose.local_dev.yml | 8 +++++--- docker/grafana/Dockerfile | 3 +-- docker/grafana_dev/Dockerfile | 3 +-- docker/prometheus/Dockerfile | 8 ++------ 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/docker/docker-compose.local.yml b/docker/docker-compose.local.yml index bd0b225a624d..37d8df104aae 100644 --- a/docker/docker-compose.local.yml +++ b/docker/docker-compose.local.yml @@ -7,28 +7,30 @@ services: build: context: prometheus environment: - # Linux: http://localhost:8008 - # MacOSX: http://host.docker.internal:8008 - BEACON_URL: localhost:8008 - VC_URL: localhost:5064 + BEACON_URL: host.docker.internal:8008 + VC_URL: host.docker.internal:5064 restart: always - network_mode: host volumes: - "prometheus:/prometheus" + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "127.0.0.1:9090:9090" grafana: build: context: .. dockerfile: docker/grafana restart: always - network_mode: host volumes: - "grafana:/var/lib/grafana" - "grafana-dashboards:/dashboards" environment: - # Linux: http://localhost:9090 - # MacOSX: http://host.docker.internal:9090 - PROMETHEUS_URL: http://localhost:9090 + PROMETHEUS_URL: http://host.docker.internal:9090 + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "3000:3000" volumes: prometheus: diff --git a/docker/docker-compose.local_dev.yml b/docker/docker-compose.local_dev.yml index 0b257d2f5971..55c87a6b5406 100644 --- a/docker/docker-compose.local_dev.yml +++ b/docker/docker-compose.local_dev.yml @@ -1,3 +1,5 @@ +version: "3.4" + # Configuration to work with a local non-dockerized Lodestar node # For local testing and quick debugging # @@ -10,15 +12,15 @@ services: build: context: prometheus environment: - BEACON_URL: http://host.docker.internal:8008 - VC_URL: http://host.docker.internal:5064 + BEACON_URL: host.docker.internal:8008 + VC_URL: host.docker.internal:5064 restart: always volumes: - "prometheus:/prometheus" extra_hosts: - "host.docker.internal:host-gateway" ports: - - "9090:9090" + - "127.0.0.1:9090:9090" grafana: build: grafana_dev diff --git a/docker/grafana/Dockerfile b/docker/grafana/Dockerfile index 91f000f0720a..daf1a2616c2b 100644 --- a/docker/grafana/Dockerfile +++ b/docker/grafana/Dockerfile @@ -14,8 +14,7 @@ VOLUME /dashboards ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -# Modified datasource to work with a network_mode: host -ENV PROMETHEUS_URL=http://prometheus:9090 +ENV PROMETHEUS_URL=host.docker.internal:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ diff --git a/docker/grafana_dev/Dockerfile b/docker/grafana_dev/Dockerfile index fe22ca3f0855..8404eb00a89b 100644 --- a/docker/grafana_dev/Dockerfile +++ b/docker/grafana_dev/Dockerfile @@ -13,8 +13,7 @@ COPY dashboards /dashboards/ ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -# Modified datasource to work with a network_mode: host -ENV PROMETHEUS_URL=http://prometheus:9090 +ENV PROMETHEUS_URL=host.docker.internal:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ diff --git a/docker/prometheus/Dockerfile b/docker/prometheus/Dockerfile index 6d56840722cb..6eb82cdeff02 100644 --- a/docker/prometheus/Dockerfile +++ b/docker/prometheus/Dockerfile @@ -4,12 +4,8 @@ COPY prometheus.yml /etc/prometheus/prometheus.yml COPY --chown=nobody:nobody entrypoint.sh /etc/prometheus/entrypoint.sh RUN chmod +x /etc/prometheus/entrypoint.sh -# Modified datasource to work with a network_mode: host -# Docker DNS: "beacon_node:8008" -# net host: "localhost:8008" -# MacOSX: "host.docker.internal:8008" -ENV BEACON_URL='beacon_node:8008' -ENV VC_URL='validator:5064' +ENV BEACON_URL='host.docker.internal:8008' +ENV VC_URL='host.docker.internal:5064' VOLUME /prometheus ENTRYPOINT ["/etc/prometheus/entrypoint.sh"] From f8a71605eee6e73bcd9abb6c60846f2df697c67e Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Fri, 24 May 2024 08:42:35 +0200 Subject: [PATCH 3/5] chore: address comments --- docker-compose.yml | 2 +- docker/docker-compose.local.yml | 2 +- docker/docker-compose.local_dev.yml | 2 +- docker/grafana/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d8c6122e3537..3c2ef481a119 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: build: docker/grafana restart: always ports: - - "3000:3000" + - "127.0.0.1:3000:3000" volumes: - "grafana:/var/lib/grafana" - "grafana-dashboards:/dashboards" diff --git a/docker/docker-compose.local.yml b/docker/docker-compose.local.yml index 37d8df104aae..a14d9a4eafbe 100644 --- a/docker/docker-compose.local.yml +++ b/docker/docker-compose.local.yml @@ -30,7 +30,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" ports: - - "3000:3000" + - "127.0.0.1:3000:3000" volumes: prometheus: diff --git a/docker/docker-compose.local_dev.yml b/docker/docker-compose.local_dev.yml index 55c87a6b5406..e25126175abd 100644 --- a/docker/docker-compose.local_dev.yml +++ b/docker/docker-compose.local_dev.yml @@ -33,7 +33,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" ports: - - "3000:3000" + - "127.0.0.1:3000:3000" volumes: prometheus: diff --git a/docker/grafana/Dockerfile b/docker/grafana/Dockerfile index daf1a2616c2b..fba9c5c11682 100644 --- a/docker/grafana/Dockerfile +++ b/docker/grafana/Dockerfile @@ -14,7 +14,7 @@ VOLUME /dashboards ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -ENV PROMETHEUS_URL=host.docker.internal:9090 +ENV PROMETHEUS_URL=http://host.docker.internal:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ From d3b083158cb8e8f6b4f14a306353129c710c119a Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 24 May 2024 00:29:04 -0700 Subject: [PATCH 4/5] Update docker-compose.yml Co-authored-by: Nico Flaig --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3c2ef481a119..d8c6122e3537 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: build: docker/grafana restart: always ports: - - "127.0.0.1:3000:3000" + - "3000:3000" volumes: - "grafana:/var/lib/grafana" - "grafana-dashboards:/dashboards" From 6f4aa0af3ceab50ab027b9c4fdfededcc1b49789 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Fri, 24 May 2024 15:37:36 +0200 Subject: [PATCH 5/5] chore: address comments --- docker/grafana/Dockerfile | 3 ++- docker/grafana_dev/Dockerfile | 3 ++- docker/prometheus/Dockerfile | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docker/grafana/Dockerfile b/docker/grafana/Dockerfile index fba9c5c11682..91f000f0720a 100644 --- a/docker/grafana/Dockerfile +++ b/docker/grafana/Dockerfile @@ -14,7 +14,8 @@ VOLUME /dashboards ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -ENV PROMETHEUS_URL=http://host.docker.internal:9090 +# Modified datasource to work with a network_mode: host +ENV PROMETHEUS_URL=http://prometheus:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ diff --git a/docker/grafana_dev/Dockerfile b/docker/grafana_dev/Dockerfile index 8404eb00a89b..fe22ca3f0855 100644 --- a/docker/grafana_dev/Dockerfile +++ b/docker/grafana_dev/Dockerfile @@ -13,7 +13,8 @@ COPY dashboards /dashboards/ ENV GF_SECURITY_ADMIN_USER=admin ENV GF_SECURITY_ADMIN_PASSWORD=admin -ENV PROMETHEUS_URL=host.docker.internal:9090 +# Modified datasource to work with a network_mode: host +ENV PROMETHEUS_URL=http://prometheus:9090 ENV DASHBOARDS_DIR=/dashboards CMD [ \ diff --git a/docker/prometheus/Dockerfile b/docker/prometheus/Dockerfile index 6eb82cdeff02..6d56840722cb 100644 --- a/docker/prometheus/Dockerfile +++ b/docker/prometheus/Dockerfile @@ -4,8 +4,12 @@ COPY prometheus.yml /etc/prometheus/prometheus.yml COPY --chown=nobody:nobody entrypoint.sh /etc/prometheus/entrypoint.sh RUN chmod +x /etc/prometheus/entrypoint.sh -ENV BEACON_URL='host.docker.internal:8008' -ENV VC_URL='host.docker.internal:5064' +# Modified datasource to work with a network_mode: host +# Docker DNS: "beacon_node:8008" +# net host: "localhost:8008" +# MacOSX: "host.docker.internal:8008" +ENV BEACON_URL='beacon_node:8008' +ENV VC_URL='validator:5064' VOLUME /prometheus ENTRYPOINT ["/etc/prometheus/entrypoint.sh"]