FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive \
    PATH="$HOME/go/bin:/usr/local/go/bin:$PATH"

RUN mkdir -p /usr/share/man/man1 /usr/share/man/man2 && \
    apt -y --no-install-recommends update && \
    apt -y --no-install-recommends install curl wget && \
    rm -f /etc/ssl/certs/ca-bundle.crt && \
    apt -y --no-install-recommends reinstall ca-certificates && \
    update-ca-certificates && \
    curl -sSL https://raw.githubusercontent.com/Xpl0itU/apt-fast/main/install.sh | bash

RUN apt-fast -y --no-install-recommends update && \
    apt-fast -y --no-install-recommends upgrade && \
    apt-fast install -y --no-install-recommends build-essential libgcrypt20-dev libgtk-3-dev libfuse2 libtool librsvg2-dev && \
    wget https://go.dev/dl/go1.26.0.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go*.linux-amd64.tar.gz && \
    chmod +x /usr/local/go/bin/go* && \
    LINUXDEPLOY="/usr/bin/linuxdeploy.AppImage" && \
    LINUXDEPLOY_PLUGIN_GTK="/usr/bin/linuxdeploy-plugin-gtk.sh" && \
    LINUXDEPLOY_PLUGIN_CHECKRT="/usr/bin/linuxdeploy-plugin-checkrt.sh" && \
    wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" -O "$LINUXDEPLOY_PLUGIN_GTK" && \
    chmod +x "$LINUXDEPLOY_PLUGIN_GTK" && \
    wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" -O "$LINUXDEPLOY" && \
    chmod +x "$LINUXDEPLOY" && \
    wget -c "https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh" -O "$LINUXDEPLOY_PLUGIN_CHECKRT" && \
    chmod +x "$LINUXDEPLOY_PLUGIN_CHECKRT"

WORKDIR /project
