This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b670267a1 Fix docker-compose quickstart for Horizon UI and OAP 
healthcheck (#13899)
1b670267a1 is described below

commit 1b670267a1329e934a015047908ccc90b61efde6
Author: 吴晟 Wu Sheng <[email protected]>
AuthorDate: Tue Jun 9 10:21:27 2026 +0800

    Fix docker-compose quickstart for Horizon UI and OAP healthcheck (#13899)
    
    Addresses apache/skywalking discussion #13896:
    
    - OAP healthcheck used `curl http://localhost:12800/internal/l7check`, but
      the eclipse-temurin JRE image ships no curl/wget/nc. Probe the query port
      with bash's built-in /dev/tcp instead, and widen start_period to 90s so
      BanyanDB schema install doesn't burn the retry budget.
    - Horizon UI listens on 8081 inside the container, not 8080; fix the port
      mapping (8080:8081).
    - The Horizon image takes its OAP URLs and login users ONLY from a mounted
      config file, not env vars. Drop the non-existent SW_OAP_ADDRESS /
      SW_ADMIN_ADDRESS / SW_ZIPKIN_ADDRESS vars and mount docker/horizon.yaml.
    - New docker/horizon.yaml: server.host 0.0.0.0 (the example config ships
      127.0.0.1, which binds container-loopback only and 503s from the host),
      oap query/admin/zipkin URLs pointed at the compose `oap` service, and a
      demo admin/admin local login.
---
 docker/README.md           |  7 ++++---
 docker/docker-compose.yml  | 24 +++++++++++++++---------
 docker/horizon.yaml        | 41 +++++++++++++++++++++++++++++++++++++++++
 docs/en/changes/changes.md |  1 +
 4 files changed, 61 insertions(+), 12 deletions(-)

diff --git a/docker/README.md b/docker/README.md
index 49a02430c8..bd2e94501e 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -77,6 +77,7 @@ docker compose --profile banyandb up
 such as the Docker image registry and tags.
 
 After the services are up and running, you can send telemetry data to
-`localhost:11800` and access the Horizon UI at <http://localhost:8080>. The OAP
-admin host is exposed on `localhost:17128` (UI templates, runtime-rule hot
-update, DSL debugging, status, inspect).
+`localhost:11800` and access the Horizon UI at <http://localhost:8080>
+(default login `admin` / `admin`, configured in 
[docker/horizon.yaml](./horizon.yaml)).
+The OAP admin host is exposed on `localhost:17128` (UI templates, runtime-rule
+hot update, DSL debugging, status, inspect).
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index b803941ce4..9f5d69b000 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -67,11 +67,15 @@ services:
     networks:
       - demo
     healthcheck:
-      test: [ "CMD-SHELL", "curl http://localhost:12800/internal/l7check"; ]
-      interval: 30s
+      # The OAP image (eclipse-temurin JRE) ships bash but no curl/wget/nc,
+      # so probe the query port with bash's built-in /dev/tcp instead.
+      test: [ "CMD", "bash", "-c", "cat < /dev/null > 
/dev/tcp/127.0.0.1/12800" ]
+      interval: 15s
       timeout: 10s
-      retries: 3
-      start_period: 10s
+      retries: 10
+      # OAP can take 60-120s to boot (BanyanDB schema install); don't count
+      # failures against the retry budget during that window.
+      start_period: 90s
     environment: &oap-env
       SW_HEALTH_CHECKER: default
       SW_TELEMETRY: prometheus
@@ -111,13 +115,15 @@ services:
     image: ${UI_IMAGE:-ghcr.io/apache/skywalking-horizon-ui:latest}
     container_name: ui
     ports:
-      - "8080:8080"
+      # Horizon listens on 8081 inside the container (HORIZON_SERVER_PORT).
+      - "8080:8081"
     networks:
       - demo
-    environment:
-      SW_OAP_ADDRESS: http://oap:12800
-      SW_ADMIN_ADDRESS: http://oap:17128
-      SW_ZIPKIN_ADDRESS: http://oap:9412
+    volumes:
+      # Backend URLs (OAP query/admin/zipkin) and login users come ONLY from
+      # this file; there are no env vars for them. The image's HORIZON_CONFIG
+      # default points here.
+      - ./horizon.yaml:/app/horizon.yaml:ro
 
 networks:
   demo:
diff --git a/docker/horizon.yaml b/docker/horizon.yaml
new file mode 100644
index 0000000000..415194600e
--- /dev/null
+++ b/docker/horizon.yaml
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Horizon UI config for the docker-compose quickstart. The image reads its
+# backend wiring and login users ONLY from this file (mounted at the image's
+# HORIZON_CONFIG path) — there are no env vars for the OAP URLs.
+
+server:
+  # Bind all interfaces. The default example config ships host: 127.0.0.1,
+  # which binds container-loopback only and 503s from the host side.
+  host: 0.0.0.0
+  port: 8081
+
+oap:
+  # Point at the `oap` service on the compose network, not 127.0.0.1.
+  queryUrl: http://oap:12800
+  adminUrl: http://oap:17128
+  zipkinUrl: http://oap:9412/zipkin
+
+# Demo login: admin / admin. Change before exposing this beyond localhost.
+# rbac defaults to enabled with the admin role granting `*`.
+auth:
+  backend: local
+  local:
+    users:
+      - username: admin
+        passwordHash: 
"$argon2id$v=19$m=65536,t=3,p=4$joV9AVlyLS3pqq4mLrYokQ$pJLkTKrz9/LzEH6YaFljdz9k8dyBiryjwSB26Diiz9U"
+        roles: [admin]
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index b29883c663..c52087517c 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -303,5 +303,6 @@
 * Add iOS app monitoring setup documentation.
 * Add WeChat / Alipay Mini Program monitoring setup documentation, plus a 
client-side-monitoring section in the security guide covering public-internet 
ingress (OTLP + `/v3/segments`) for mobile / browser / mini-program SDKs.
 * Improve downsampling documentation
+* Fix the docker-compose quickstart: OAP healthcheck no longer calls `curl` 
(absent from the JRE image) and probes the query port via bash `/dev/tcp`; the 
Horizon UI service maps the correct container port (8081) and mounts a 
`horizon.yaml` (binding `0.0.0.0`, OAP URLs, demo `admin`/`admin` login) 
instead of non-existent `SW_*_ADDRESS` env vars.
 
 All issues and pull requests are 
[here](https://github.com/apache/skywalking/issues?q=milestone:11.0.0)

Reply via email to