This repository has been archived on 2022-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
Files
docker-wg-cgnat/Dockerfile
2022-02-06 21:07:45 +01:00

35 lines
1.2 KiB
Docker

FROM ich777/debian-baseimage
LABEL maintainer="admin@minenet.at"
RUN apt-get update && \
apt-get -y install --no-install-recommends nano openssh-server wireguard wireguard-tools iproute2 iptables && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /run/sshd && \
rm -v /etc/ssh/ssh_host_* && \
sed -i "/#PubkeyAuthentication yes/c\PubkeyAuthentication yes" /etc/ssh/sshd_config && \
sed -i "/#PasswordAuthentication yes/c\PasswordAuthentication no" /etc/ssh/sshd_config && \
sed -i "/StrictHostKeyChecking/c\ StrictHostKeyChecking no" /etc/ssh/ssh_config && \
sed -i "/IdentityFile ~\/.ssh\/id_rsa/c\ IdentityFile \/root\/ssh\/ssh_host_rsa_key" /etc/ssh/ssh_config && \
sed -i "/PROGRAM must be run as root. Please enter the password for/c\ :" /usr/bin/wg-quick && \
sed -i "/cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1/d" /usr/bin/wg-quick
ENV DATA_DIR="/root"
ENV HOST=""
ENV USE_FILE="false"
ENV RSA_BITS=4096
ENV SUBNET=172.30.30.0
ENV REMOTE_LISTEN_PORT=30833
ENV WG_CONFIG_NO=99
ENV KEEPALIVE=25
ENV UID=99
ENV GID=100
ENV UMASK=0000
ENV DATA_PERM=770
RUN ulimit -n 2048
ADD /scripts/ /opt/scripts/
RUN chmod -R 770 /opt/scripts/
#Server Start
ENTRYPOINT ["/opt/scripts/start.sh"]