<gh_stars>0
FROM ubuntu:20.04

WORKDIR /tmp

# env
ENV DEBIAN_FRONTEND noninteractive
ENV DISPLAY :0
ENV USER root
ENV VGL true

# perform system update and upgrade
RUN apt update -y \
    && apt install apt-utils -y \
    && apt upgrade -y

# bring in desktop scripts
COPY --chown=root:root ./src/system src/system
RUN chmod -R +x ./src/system

# system install
RUN sh src/system/core.sh
RUN sh src/system/shell.sh
RUN sh src/system/xfce.sh
RUN sh src/system/applications.sh

# run system clean up
RUN apt clean -y \
    && apt autoclean -y \
    && apt autoremove --purge -y

COPY --chown=root:root ./src/desktop/ src/desktop/
COPY --chown=root:root ./src/polaris/ /opt/polaris/
WORKDIR /opt/polaris/dev/
RUN chmod -R +x /opt/polaris/* \
    && sh ./install-polaris-skel \
    && sh ./install-polaris-backgrounds \
    && sh ./install-polaris-xdg

# switch to root
WORKDIR /

# clean up src
RUN rm -rfv /tmp/*


CMD [ "/bin/sh", "-c", "/opt/polaris/launch.sh" ]
