1.Add Agent To Docker
Dockerfiled:
FROM frolvlad/alpine-oraclejre8:slim VOLUME /tmp ADD role-service-0.0.1-SNAPSHOT.jar role-service.jar COPY agent/ /usr/local/skyagent/ ENV CE=$CE EXPOSE 11005 ENV JAVA_OPTS=""AGENT_SERVICE_NAME="default" AGENT_COLLECTOR_ADDRESS="ip:11800" ENTRYPOINT java -javaagent:/usr/local/skyagent/skywalking-agent.jar=agent.service_name=${AGENT_SERVICE_NAME},collector.backend_service=${AGENT_COLLECTOR_ADDRESS} ${JAVA_OPTS} -jar /role-service.jar
AGENT_SERVICE_NAME=你的服务名字' -e 'AGENT_COLLECTOR_ADDRESS=192.168.18.177:11800'
启动docker 的时候 设置收集到 192.168.18.177
http://192.168.18.177/sss/portal.html
启动docker:
sudo docker run -it -d --restart unless-stopped --name customerserice -p 7778:7778 --net host -v /tmp/customer-service/log/:/tmp/ -v /etc/localtime:/etc/localtime:ro -e 'JAVA_OPTS=-Xmx256m -Xms256m' -e 'AGENT_SERVICE_NAME=Customer-Service' -e 'AGENT_COLLECTOR_ADDRESS=192.168.18.135:11800' -e 'CE='customerservice:service-test