vpn / Dockerfile
mugambiii's picture
Create Dockerfile
fe44f53 verified
Raw
History Blame Contribute Delete
1.13 kB
FROM ubuntu:22.04
# 1. Install core dependencies
RUN apt-get update && \
apt-get install -y openssh-server curl wget python3 && \
rm -rf /var/lib/apt/lists/*
# 2. Setup SSH
RUN mkdir -p /var/run/sshd && \
ssh-keygen -A && \
echo 'root:clin2008' | chpasswd && \
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# 3. Download 'bore' using a DIRECT, HARDCODED link (No more GitHub API parsing!)
RUN wget -q https://github.com/ekzhang/bore/releases/download/v0.5.2/bore-v0.5.2-x86_64-unknown-linux-musl.tar.gz -O /tmp/bore.tar.gz && \
tar -xzf /tmp/bore.tar.gz -C /usr/local/bin && \
rm /tmp/bore.tar.gz
# 4. Set your custom terminal prompt
RUN echo 'export PS1="\u@clinton-VM:\w\$ "' >> /root/.bashrc
EXPOSE 7860
# 5. Start services.
# If bore fails, 'sleep infinity' prevents the container from crashing and causing a 503.
CMD ["/bin/bash", "-c", "/usr/sbin/sshd ; python3 -m http.server 7860 > /dev/null 2>&1 & bore local 22 --to bore.pub || sleep infinity"]