ARG PARENT_IMAGE=086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:debian13
FROM $PARENT_IMAGE AS parent

LABEL parent-images=debian13,java17

USER root

RUN apt-get -y update \
  && apt-get -y upgrade \
  && apt-get -y install curl procps gnupg wget apt-transport-https \
  && wget -O- https://apt.corretto.aws/corretto.key | gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg \
  && echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" > /etc/apt/sources.list.d/corretto.list \
  && apt-get -y update \
  && apt-get -y install java-17-amazon-corretto-jdk \
  && apt-get -y remove gnupg wget apt-transport-https \
  && apt-get -y autoremove \
  && apt-get -y clean \
  && rm -rf /var/lib/apt/lists/*

# Run container as the worker user
USER worker
