Sign inSign up

01145140/debian-vps

By 01145140

•Updated 10 days ago

Image
0

743

01145140/debian-vps repository overview

⁠v1.0

FROM debian:trixie

ARG USERNAME
ARG PASSWORD

ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends \
        curl screen ca-certificates xz-utils \
        golang-go python3 python3-pip python3-venv \
        openjdk-21-jdk-headless git nodejs npm vim bash sudo \
        iputils-ping iproute2 net-tools bind9-dnsutils traceroute netcat-openbsd \
        tcpdump telnet wget socat openssh-client mtr-tiny systemd systemd-sysv dbus tmux nano cron 

# ttyd was dropped from Debian repos, so fetch the official static binary
RUN case "$(dpkg --print-architecture)" in \
        amd64) TTYD_ASSET=ttyd.x86_64 ;; \
        arm64) TTYD_ASSET=ttyd.aarch64 ;; \
        *) echo "unsupported arch: $(dpkg --print-architecture)" >&2; exit 1 ;; \
    esac \
    && curl -fsSL -o /usr/local/bin/ttyd \
        "https://github.com/tsl0922/ttyd/releases/latest/download/${TTYD_ASSET}" \
    && chmod 0755 /usr/local/bin/ttyd \
    && ttyd --version

EXPOSE 2222

WORKDIR /workspace

CMD ["sh", "-c", "ttyd -W -p 2222 -c $USERNAME:$PASSWORD bash"]

v2.0

FROM debian:trixie

ARG USERNAME
ARG PASSWORD

ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends \
        curl screen ca-certificates xz-utils \
        golang-go python3 python3-pip python3-venv \
        openjdk-21-jdk-headless git nodejs npm vim bash sudo \
        iputils-ping iproute2 net-tools bind9-dnsutils traceroute netcat-openbsd \
        tcpdump telnet wget socat openssh-client mtr-tiny systemd systemd-sysv dbus tmux nano cron htop procps

RUN apt-get install -y --no-install-recommends p7zip-full

RUN apt-get update && \
    apt-get install -y --no-install-recommends ca-certificates curl && \
    ARCH="$(uname -m)" && \
    case "${ARCH}" in \
        x86_64|amd64) CF_ARCH="amd64" ;; \
        armv8|arm64|aarch64) CF_ARCH="arm64" ;; \
        armv7l) CF_ARCH="arm" ;; \
        i386|i686) CF_ARCH="386" ;; \
        *) CF_ARCH="amd64" ;; \
    esac && \
    curl -sL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${CF_ARCH}" -o /usr/local/bin/cloudflared && \
    chmod +x /usr/local/bin/cloudflared

# ttyd was dropped from Debian repos, so fetch the official static binary
RUN case "$(dpkg --print-architecture)" in \
        amd64) TTYD_ASSET=ttyd.x86_64 ;; \
        arm64) TTYD_ASSET=ttyd.aarch64 ;; \
        *) echo "unsupported arch: $(dpkg --print-architecture)" >&2; exit 1 ;; \
    esac \
    && curl -fsSL -o /usr/local/bin/ttyd \
        "https://github.com/tsl0922/ttyd/releases/latest/download/${TTYD_ASSET}" \
    && chmod 0755 /usr/local/bin/ttyd \
    && ttyd --version

RUN curl https://getcroc.com | bash

EXPOSE 2222

WORKDIR /workspace

CMD ["sh", "-c", "ttyd -W -p 2222 -c $USERNAME:$PASSWORD bash"]

v3.0

FROM debian:trixie

# 组网工具版本:默认官方最新稳定版,可用 --build-arg FRP_VERSION=0.72.0 之类固定
ARG TAILSCALE_VERSION=latest
ARG EASYTIER_VERSION=latest
ARG FRP_VERSION=latest

ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends \
        curl screen ca-certificates xz-utils unzip jq \
        golang-go python3 python3-pip python3-venv \
        openjdk-21-jdk-headless git nodejs npm vim bash sudo \
        iputils-ping iproute2 net-tools bind9-dnsutils traceroute netcat-openbsd \
        tcpdump telnet wget socat openssh-client openssh-server iptables \
        mtr-tiny systemd systemd-sysv dbus tmux nano cron htop procps p7zip-full

RUN apt-get update && \
    apt-get install -y --no-install-recommends ca-certificates curl && \
    ARCH="$(uname -m)" && \
    case "${ARCH}" in \
        x86_64|amd64) CF_ARCH="amd64" ;; \
        armv8|arm64|aarch64) CF_ARCH="arm64" ;; \
        armv7l) CF_ARCH="arm" ;; \
        i386|i686) CF_ARCH="386" ;; \
        *) CF_ARCH="amd64" ;; \
    esac && \
    curl -sL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${CF_ARCH}" -o /usr/local/bin/cloudflared && \
    chmod +x /usr/local/bin/cloudflared

# ttyd was dropped from Debian repos, so fetch the official static binary
RUN case "$(dpkg --print-architecture)" in \
        amd64) TTYD_ASSET=ttyd.x86_64 ;; \
        arm64) TTYD_ASSET=ttyd.aarch64 ;; \
        *) echo "unsupported arch: $(dpkg --print-architecture)" >&2; exit 1 ;; \
    esac \
    && curl -fsSL -o /usr/local/bin/ttyd \
        "https://github.com/tsl0922/ttyd/releases/latest/download/${TTYD_ASSET}" \
    && chmod 0755 /usr/local/bin/ttyd \
    && ttyd --version

RUN curl https://getcroc.com | bash

# 只安装 Tailscale / EasyTier / frp 的二进制,启动由使用者自行在 CLI 里执行
RUN set -eux; \
    case "$(dpkg --print-architecture)" in \
        amd64) TS_ARCH=amd64; ET_ARCH=x86_64; FRP_ARCH=amd64 ;; \
        arm64) TS_ARCH=arm64; ET_ARCH=aarch64; FRP_ARCH=arm64 ;; \
        *) echo "unsupported arch: $(dpkg --print-architecture)" >&2; exit 1 ;; \
    esac; \
    latest_tag() { curl -fsSL -o /dev/null -w '%{url_effective}' "https://github.com/$1/releases/latest" | sed 's#.*/##'; }; \
    TS_VER="${TAILSCALE_VERSION#v}"; \
    if [ "$TS_VER" = "latest" ]; then \
        TS_VER="$(curl -fsSL 'https://pkgs.tailscale.com/stable/?mode=json' | jq -r '.TarballsVersion')"; \
    fi; \
    curl -fsSL -o /tmp/tailscale.tgz "https://pkgs.tailscale.com/stable/tailscale_${TS_VER}_${TS_ARCH}.tgz"; \
    tar -xzf /tmp/tailscale.tgz -C /tmp; \
    install -m 0755 "/tmp/tailscale_${TS_VER}_${TS_ARCH}/tailscale" /usr/local/bin/tailscale; \
    install -m 0755 "/tmp/tailscale_${TS_VER}_${TS_ARCH}/tailscaled" /usr/local/bin/tailscaled; \
    ET_VER="${EASYTIER_VERSION#v}"; \
    if [ "$ET_VER" = "latest" ]; then ET_VER="$(latest_tag EasyTier/EasyTier | sed 's/^v//')"; fi; \
    ET_TAG="v${ET_VER}"; \
    curl -fsSL -o /tmp/easytier.zip "https://github.com/EasyTier/EasyTier/releases/download/${ET_TAG}/easytier-linux-${ET_ARCH}-${ET_TAG}.zip"; \
    unzip -oq /tmp/easytier.zip -d /tmp; \
    install -m 0755 "/tmp/easytier-linux-${ET_ARCH}/easytier-core" /usr/local/bin/easytier-core; \
    install -m 0755 "/tmp/easytier-linux-${ET_ARCH}/easytier-cli" /usr/local/bin/easytier-cli; \
    FRP_VER="${FRP_VERSION#v}"; \
    if [ "$FRP_VER" = "latest" ]; then FRP_VER="$(latest_tag fatedier/frp | sed 's/^v//')"; fi; \
    curl -fsSL -o /tmp/frp.tgz "https://github.com/fatedier/frp/releases/download/v${FRP_VER}/frp_${FRP_VER}_linux_${FRP_ARCH}.tar.gz"; \
    tar -xzf /tmp/frp.tgz -C /tmp; \
    install -m 0755 "/tmp/frp_${FRP_VER}_linux_${FRP_ARCH}/frpc" /usr/local/bin/frpc; \
    install -m 0755 "/tmp/frp_${FRP_VER}_linux_${FRP_ARCH}/frps" /usr/local/bin/frps; \
    rm -rf /tmp/tailscale.tgz /tmp/tailscale_* /tmp/easytier.zip /tmp/easytier-linux-* /tmp/frp.tgz /tmp/frp_*; \
    tailscale version | head -n 1; \
    easytier-core --version; \
    frpc --version; \
    frps --version

# SSH:构建期只放开 root 密码登录并生成主机密钥,密码在容器启动时设置
RUN mkdir -p /run/sshd /etc/ssh/sshd_config.d && \
    ssh-keygen -A && \
    printf '%s\n' 'PermitRootLogin yes' 'PasswordAuthentication yes' 'PermitEmptyPasswords no' \
        > /etc/ssh/sshd_config.d/10-root-login.conf

EXPOSE 22 2222

WORKDIR /workspace

#密码指定,未指定则随机生成并打印到
CMD ["sh", "-c", "ttyd -W -p 2222 -c $USERNAME:$PASSWORD bash"]

Tag summary

Content type

Image

Digest

sha256:48f467017…

Size

553.5 MB

Last updated

10 days ago

docker pull 01145140/debian-vps