# Use the latest version to avoid stale versioning.
FROM tchiotludo/akhq:latest

USER root

# Run updates and install curl and envsubst.
RUN apt-get -y update \
  && apt-get -y upgrade \
  && apt-get install -y curl gettext-base \
  && apt-get -y clean \
  && rm -rf /var/lib/apt/lists/*

# Add custom entrypoint.
COPY entrypoint.sh /usr/local/bin/
RUN chown root:root /usr/local/bin/entrypoint.sh \
  && chmod 755 /usr/local/bin/entrypoint.sh

USER akhq

# Mitigate CVE-2021-44228
# https://msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2/
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS="true"

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

#FORCE REDEPLOY:1
