Add swctl to docker image for health check (#5139)

This commit is contained in:
Gao Hongtao 2020-08-06 10:54:40 +08:00 committed by GitHub
parent 68ab389021
commit 24eeb5d83b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
version: '3.3'
version: '3.5'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_TAG}
@ -42,6 +42,14 @@ services:
environment:
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
SW_HEALTH_CHECKER: default
SW_TELEMETRY: prometheus
healthcheck:
test: ["CMD", "./bin/swctl", "ch"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
ui:
image: skywalking/ui:${TAG}
container_name: ui

View File

@ -16,6 +16,8 @@
ARG JAVA_VERSION=8
FROM apache/skywalking-base:8.1.0-es6 AS cli
FROM adoptopenjdk/openjdk$JAVA_VERSION:alpine
ENV JAVA_OPTS=" -Xms256M " \
@ -31,10 +33,13 @@ RUN set -ex; \
rm -rf "$DIST_NAME.tar.gz"; \
rm -rf "$DIST_NAME/config/log4j2.xml"; \
rm -rf "$DIST_NAME/bin"; rm -rf "$DIST_NAME/webapp"; rm -rf "$DIST_NAME/agent"; \
mkdir "$DIST_NAME/bin"; \
mv "$DIST_NAME" skywalking;
WORKDIR skywalking
COPY --from=cli /skywalking/bin/swctl ./bin
COPY log4j2.xml config/
COPY docker-entrypoint.sh .
RUN mkdir ext-config; \