ssh-tunnel/Dockerfile.tailscale

32 lines
891 B
Text
Raw Normal View History

2025-02-21 15:47:11 +01:00
# Use Alpine Linux
FROM alpine:latest
2025-02-24 02:31:15 +01:00
# Install required packages, including iptables
RUN apk add --no-cache openssh-client autossh bash logrotate gettext tailscale iptables ip6tables
2025-02-21 15:47:11 +01:00
# Define required environment variables
ENV SSH_HOST=""
ENV SSH_USER=""
ENV REMOTE_PORTS=""
ENV LOCAL_PORTS=""
2025-02-24 02:31:15 +01:00
# Default authentication key (optional)
ENV TAILSCALE_AUTH_KEY=""
# Custom parameters
2025-02-24 01:54:00 +01:00
ENV TAILSCALE_PARAM=""
2025-02-21 15:47:11 +01:00
ENV LOGROTATE_FREQUENCY="daily"
ENV LOGROTATE_ROTATE="7"
ENV LOGROTATE_COMPRESS="compress"
# Create necessary directories
RUN mkdir -p /root/.ssh && chmod 700 /root/.ssh
RUN mkdir -p /var/log/ssh-tunnel && chmod 777 /var/log/ssh-tunnel
RUN mkdir -p /var/lib/tailscale && chmod 700 /var/lib/tailscale
2025-02-21 15:47:11 +01:00
# Copy scripts
2025-02-24 02:31:15 +01:00
COPY entrypoint.tailscale.sh /entrypoint.sh
2025-02-21 15:47:11 +01:00
COPY logrotate.template /logrotate.template
RUN chmod +x /entrypoint.sh
# Run the entrypoint script
CMD ["/entrypoint.sh"]