You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/04/05 09:17:30 UTC

[skywalking-docker] branch agent created (now 1ff60a2)

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

kezhenxu94 pushed a change to branch agent
in repository https://gitbox.apache.org/repos/asf/skywalking-docker.git.


      at 1ff60a2  Add Java agent Dockerfile and build / push script

This branch includes the following new commits:

     new 1ff60a2  Add Java agent Dockerfile and build / push script

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[skywalking-docker] 01/01: Add Java agent Dockerfile and build / push script

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch agent
in repository https://gitbox.apache.org/repos/asf/skywalking-docker.git

commit 1ff60a28963778ca64ef42e6f9c1cb86f5c0c26f
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Mon Apr 5 17:17:11 2021 +0800

    Add Java agent Dockerfile and build / push script
---
 Makefile              | 14 +++++++++++++-
 java-agent/Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++
 java-agent/README.md  | 27 +++++++++++++++++++++++++++
 3 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5df0fd5..064affe 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ BASE_BUILD_TARGETS := $(TAG_SUFS:%=base.%)
 OAP_BUILD_TARGETS := $(TAG_SUFS:%=oap-server.%)
 COMPLEX_BUILD_TARGETS := $(BASE_BUILD_TARGETS) $(OAP_BUILD_TARGETS)
 COMPOSE_TARGETS := $(TAG_SUFS:%=compose.%)
-BUILD_TARGETS := $(COMPLEX_BUILD_TARGETS) ui
+BUILD_TARGETS := $(COMPLEX_BUILD_TARGETS) ui java-agent
 
 word-dot = $(word $2,$(subst ., ,$1))
 
@@ -46,6 +46,14 @@ ui:
 	&& $(D) tag apache/skywalking-ui:$(SW_VERSION) apache/skywalking-ui:latest \
 	&& popd
 
+java-agent:
+	@echo "Building Java Agent"
+	pushd $(ROOT)/java-agent \
+	&& $(D) build $(SW_BUILD_ARGS) -t apache/skywalking-java-agent:$(SW_VERSION)-jdk8-alpine . \
+	&& $(D) tag apache/skywalking-java-agent:$(SW_VERSION)-jdk8-alpine apache/skywalking-java-agent:latest \
+	&& popd
+
+
 $(COMPOSE_TARGETS):
 	@echo "Booting $@"
 	$(eval imgTag := $(subst compose.,,$@))
@@ -60,6 +68,10 @@ push.ui:
 	$(D) push apache/skywalking-ui:$(SW_VERSION) \
 	&& $(D) push  apache/skywalking-ui:latest
 
+push.java-agent:
+	$(D) push apache/skywalking-java-agent:$(SW_VERSION)-jdk8-alpine \
+	&& $(D) push  apache/skywalking-java-agent:latest
+
 PUSH_TARGETS:=
 $(foreach TGT,$(BUILD_TARGETS),$(eval PUSH_TARGETS+=push.$(TGT)))
 
diff --git a/java-agent/Dockerfile b/java-agent/Dockerfile
new file mode 100644
index 0000000..49e5401
--- /dev/null
+++ b/java-agent/Dockerfile
@@ -0,0 +1,38 @@
+# 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.
+
+ARG BASE_IMAGE='adoptopenjdk/openjdk8:alpine'
+
+FROM alpine as build
+
+ARG DIST_NAME
+
+ADD "$DIST_NAME.tar.gz" /
+
+RUN mv /$DIST_NAME /skywalking
+
+FROM apache/skywalking-base:8.4.0-es6 AS cli
+
+FROM $BASE_IMAGE
+
+LABEL maintainer="kezhenxu94@apache.org"
+
+ENV JAVA_TOOL_OPTIONS=-javaagent:/skywalking/agent/skywalking-agent.jar
+
+WORKDIR /skywalking
+
+COPY --from=build /skywalking/agent /skywalking/agent
+COPY --from=cli /skywalking/bin/swctl /skywalking/bin
diff --git a/java-agent/README.md b/java-agent/README.md
new file mode 100644
index 0000000..01650c1
--- /dev/null
+++ b/java-agent/README.md
@@ -0,0 +1,27 @@
+# Apache SkyWalking Agent docker file
+
+**Docker images are not official ASF releases but provided for convenience. Recommended usage is always to build the source**
+
+<img src="http://skywalking.apache.org/assets/logo.svg" alt="Sky Walking logo" height="90px" align="right" />
+
+**SkyWalking**: an APM(application performance monitor) system, especially designed for 
+microservices, cloud native and container-based (Docker, Kubernetes, Mesos) architectures.
+
+[![GitHub stars](https://img.shields.io/github/stars/apache/skywalking.svg?style=for-the-badge&label=Stars&logo=github)](https://github.com/apache/skywalking)
+[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=for-the-badge&label=Follow&logo=twitter)](https://twitter.com/AsfSkyWalking)
+
+You could find docker file at [here](https://github.com/apache/skywalking-docker)
+
+This image only hosts the pre-built SkyWalking Java agent jars, and provides some convenient configurations for containerization scenarios.
+
+# How to use this image
+
+Build your Java application Docker image `FROM` this image.
+
+```dockerfile
+FROM apache/skywalking-java-agent:8.5.0-jdk8-alpine
+// ....
+```
+
+# License
+[Apache 2.0 License.](/LICENSE)