# SPDX-License-Identifier: GPL-3.0-or-later # Copyright (C) 2025 Jesus E. # # This file is part of # This program is licensed under the GNU GPL version 3 or (at your option) any later version. # See the LICENSE file or https://www.gnu.org/licenses/gpl-3.0.txt for more details. FROM debian:bookworm-slim ENV DEBIAN_FRONTEND=noninteractive ENV AWS_CLI_VERSION=2 ENV KUBECTL_VERSION=1.32.0 ENV ARCH=amd64 ENV PLATFORM=Linux_${ARCH} ENV DOCKER_USER=coder \ UID=1000 \ GID=1000 \ PASSWORD=undefined \ HASHED_PASSWORD=undefined RUN apt-get update && apt-get install -y \ bash curl unzip gnupg net-tools tree bash-completion sudo \ default-jre jq python3 python3-pip python3-venv virtualenv \ siege tar ca-certificates wget git dumb-init nodejs npm \ lsb-release iproute2 iptables uidmap dbus fuse3 xz-utils doas passwd \ && apt-get clean && rm -rf /var/lib/apt/lists/* RUN curl -fsSL https://get.docker.com | sh && dockerd --version RUN pip3 install --break-system-packages pipx && \ pipx install pre-commit && \ ln -s /root/.local/pipx/venvs/pre-commit/bin/pre-commit /usr/local/bin/pre-commit RUN curl -o awscliv2.zip https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip && \ unzip awscliv2.zip && ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ rm -rf awscliv2.zip aws/ RUN curl -o kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/${KUBECTL_VERSION}/2024-12-20/bin/linux/amd64/kubectl && \ chmod +x kubectl && mv kubectl /usr/local/bin/ RUN curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_${PLATFORM}.tar.gz" && \ curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check && \ tar -xzf eksctl_${PLATFORM}.tar.gz -C /tmp && \ mv /tmp/eksctl /usr/local/bin && rm eksctl_${PLATFORM}.tar.gz RUN curl -fsSL https://code-server.dev/install.sh | sh # Install prompt to root RUN curl -Ls https://git.fridu.us/heckyel/hyperterm/raw/branch/master/install.sh -o "$HOME/install.sh" && \ bash "$HOME/install.sh" -s # Copy pre-commit config and setup script COPY .pre-commit-config.yaml /usr/local/share/default-pre-commit-config.yaml COPY .setup-precommit.sh /usr/local/bin/setup-precommit RUN chmod +x /usr/local/bin/setup-precommit # Install Gitleaks ENV GITLEAKS_VERSION="8.27.0" RUN curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" -o gitleaks.tar.gz && \ tar -xzf gitleaks.tar.gz gitleaks && \ mv gitleaks /usr/local/bin/gitleaks && \ chmod +x /usr/local/bin/gitleaks && \ rm gitleaks.tar.gz # Install BFG Repo-Cleaner ENV BFG_VERSION=1.15.0 RUN curl -L -o /usr/local/bin/bfg.jar "https://repo1.maven.org/maven2/com/madgag/bfg/${BFG_VERSION}/bfg-${BFG_VERSION}.jar" && \ echo '#!/bin/sh\nexec java -jar /usr/local/bin/bfg.jar "$@"' > /usr/local/bin/bfg && \ chmod +x /usr/local/bin/bfg COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh VOLUME ["/home/coder"] EXPOSE 8080 ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["/usr/local/bin/entrypoint.sh"]