How can I install jmap on my docker container to get its heap dump once its deployed to AWS ECS as a container.I am using distroless as my base java image.Below is my dockerFile.I have managed to install all other utilities in my container other than jmap
FROM progrium/busybox as prgbusybox
RUN opkg-install curl bash git
FROM busybox:1.35.0-uclibc as busybox
FROM gcr.io/distroless/java:11
COPY --from=busybox /bin/wget /bin/wget
COPY --from=prgbusybox /usr/bin/curl /bin/curl
COPY --from=prgbusybox /bin/cat /bin/cat
COPY --from=prgbusybox /bin/ls /bin/ls
COPY --from=prgbusybox /bin/grep /bin/grep
COPY --from=prgbusybox /bin/ps /bin/ps
COPY --from=prgbusybox /bin/cp /bin/cp
COPY --from=prgbusybox /bin/chmod /bin/chmod
COPY --from=prgbusybox /bin/mkdir /bin/mkdir
COPY --from=prgbusybox /bin/sh /bin/sh
COPY target/my-app*.jar /app/app.jar
WORKDIR /app
RUN wget https://github.com/apangin/jattach/releases/download/v1.5/jattach && chmod +x jattach
ENTRYPOINT ["java","-Xlog:gc=debug:file=./gc.log:time,uptime,level,tags:filecount=10,filesize=10m", "-XX:InitialHeapSize=700M","-XX:MaxHeapSize=1024M", "-jar", "app.jar"]
HEALTHCHECK NONE