# Base Dockerfile for all build and 'production' images

ARG BASE_IMAGE=harbor.catalyst.net.nz/catalyst/ubuntu:24.04

FROM ${BASE_IMAGE}

# we set the default LANG and Locale. This was done for us in catatlyst/ubuntu:20.04, try:
#   docker run --rm harbor.catalyst.net.nz/catalyst/ubuntu:20.04 locale
ENV LANG=en_NZ.UTF-8
ENV LC_ALL=C.UTF-8

RUN apt-get update \
    && apt-get -y install openjdk-17-jdk-headless \
    && apt-get autoremove -yq \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    rm -rf /var/lib/apt/lists/*


# if the ubuntu user exists delete it (probably uses the uid/gid we want and exists in 24.04)
RUN userdel -r ubuntu || true
RUN useradd -mUs /bin/bash -u 1000 riskscape # uid 1000 is the ubuntu user, but we nuked that

USER riskscape

ENTRYPOINT ["/bin/bash"]
