如何在Neo4j Docker映像中包含Yourkit?

时间:2019-06-06 23:25:05

标签: docker neo4j yourkit

大家好,我们正在尝试采用3.5.5企业Dockerfile(https://github.com/neo4j/docker-neo4j-publish/blob/master/3.5.5/community/Dockerfile)并添加YourKit的Docker相关命令(https://www.yourkit.com/docs/java/help/docker.jsp

所以首先我尝试在不更改Yourkit的情况下通过docker构建Dockerfile,但出现此错误:

Sending build context to Docker daemon  3.072kB                                                                                                                                     │·······················
Step 1/13 : FROM openjdk:8-jre-alpine                                                                                                                                               │·······················
 ---> f7a292bbb70c                                                                                                                                                                  │·······················
Step 2/13 : RUN addgroup -S neo4j && adduser -S -H -h /var/lib/neo4j -G neo4j neo4j                                                                                                 │·······················
 ---> Using cache                                                                                                                                                                   │·······················
 ---> e0b1355abc58                                                                                                                                                                  │·······················
Step 3/13 : ENV NEO4J_SHA256=0421bb95fd377a1a45cd0a22f3f4163d8b2b07d1f9d8979e42c7f1952961ab92     NEO4J_TARBALL=neo4j-enterprise-3.5.5-unix.tar.gz     NEO4J_EDITION=enterprise     │·······················
NEO4J_HOME="/var/lib/neo4j"                                                                                                                                                         │·······················
 ---> Running in f33c9400f05b                                                                                                                                                       │·······················
Removing intermediate container f33c9400f05b                                                                                                                                        │·······················
 ---> b5db09236a0f                                                                                                                                                                  │·······················
Step 4/13 : ARG NEO4J_URI=http://dist.neo4j.org/neo4j-enterprise-3.5.5-unix.tar.gz                                                                                                  │·······················
 ---> Running in 722c0d5ef000                                                                                                                                                       │·······················
Removing intermediate container 722c0d5ef000                                                                                                                                        │·······················
 ---> 05ff355a8396                                                                                                                                                                  │·······················
Step 5/13 : COPY ./local-package/* /tmp/                                                                                                                                            │·······················
COPY failed: no source files were specified```
(edited)

一旦成功,我将添加针对yourkit的RUN命令。

1 个答案:

答案 0 :(得分:0)

一个人可以简单地执行以下操作:

FROM neo4j:3.5.5

RUN wget https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2019.1-docker.zip -P /tmp/ && \
  unzip /tmp/YourKit-JavaProfiler-2019.1-docker.zip -d /usr/local && \
  rm /tmp/YourKit-JavaProfiler-2019.1-docker.zip

RUN apk add --no-cache --quiet libc6-compat

ENV PATH "${NEO4J_HOME}"/bin:/lib64:$PATH
ENV LD_LIBRARY_PATH /lib64:$LD_LIBRARY_PATH

VOLUME /data /logs

EXPOSE 7474 7473 7687 10001

ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["neo4j"]