anchor.diff:  ADD https://artifacts.elastic.co/GPG-KEY-elasticsearch /usr/share/keyrings/elasticsearch-keyring.asc
   RUN gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg /usr/share/keyrings/elasticsearch-keyring.asc && \
       echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/${es_ver}.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-${es_ver}.x.list
  -RUN apt-get update && \
  +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
  +    --mount=type=cache,target=/var/lib/apt,sharing=locked \
  +    apt-get update && \
       apt-get install --no-install-recommends -y \
           elasticsearch \
           kibana \
       && \
  -    apt-get clean && \
  -    rm -rf /var/lib/apt/lists/* /tmp/*
  +    rm -rf /tmp/*
   RUN echo "ES_JAVA_HOME=\"${ES_JAVA_HOME}\"" >> /etc/default/elasticsearch
   
   # Install RabbitMQ
  
positive.code: SHELL [ "/bin/bash", "-c" ]
  
  # not-logstash script and init script
  COPY not-logstash/not-logstash.py /var/lib/irods-elk/bin/not-logstash
  COPY not-logstash/not-logstash.init /etc/init.d/not-logstash
  RUN chmod +x /var/lib/irods-elk/bin/not-logstash \
               /etc/init.d/not-logstash
  
  WORKDIR /var/lib/irods-elk
  
  COPY startup-script.sh /var/lib/irods-elk/startup-script.sh
  RUN chmod +x /var/lib/irods-elk/startup-script.sh
  ENTRYPOINT ["/var/lib/irods-elk/startup-script.sh"]
  
negative.code:     apt-get install -y \
          adoptium-ca-certificates \
      && \
      rm -rf /tmp/*
  ARG java_ver=17
  ARG java_vendor=temurin
  ARG java_dist=jdk
  RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
      --mount=type=cache,target=/var/lib/apt,sharing=locked \
      apt-get update && \
      apt-get install --no-install-recommends -y \
          ${java_vendor}-${java_ver}-${java_dist} \
      && \
      rm -rf /tmp/*
  ENV JAVA_HOME=/usr/lib/jvm/${java_vendor}-${java_ver}-${java_dist}-amd64
  RUN update-java-alternatives --set ${JAVA_HOME}
  ENV ES_JAVA_HOME=${JAVA_HOME}
  