如何将 Yourkit 包含在 neo4j docker 图像中?

How to include Yourkit inside a neo4j docker image?

尝试使用 3.5.5 企业版 Dockerfile (https://github.com/neo4j/docker-neo4j-publish/blob/master/3.5.5/community/Dockerfile) and to add YourKit's Docker related commands (https://www.yourkit.com/docs/java/help/docker.jsp)

所以我首先尝试 docker 在不更改 Yourkit 的情况下构建 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 命令。

可以简单地改为执行以下操作:

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"]