diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 811883a..4a1afef 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -custom: [https://pay.cloudtips.ru/p/937f48ac, https://boosty.to/evilfreelancer] +custom: [https://pay.cloudtips.ru/p/937f48ac, https://boosty.to/evilfreelancer] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 42efebe..178ed4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.idea/ /*.vdi /docker-compose.yml +build.txt \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e5fa1f7..e2f0e7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,8 @@ EXPOSE 1194 1701 1723 1812/udp 1813/udp 21 22 23 443 4500/udp 50 500/udp 51 2021 # Change work dir (it will also create this folder if is not exist) WORKDIR /routeros +RUN mkdir -p /routeros_source + # Install dependencies RUN set -xe \ && apk add --no-cache --update \ @@ -23,11 +25,11 @@ ENV ROUTEROS_IMAGE="chr-${ROUTEROS_VERSION}.vdi" ENV ROUTEROS_PATH="https://cdn.mikrotik.com/routeros/${ROUTEROS_VERSION}/${ROUTEROS_IMAGE}.zip" # Download VDI image from remote site -RUN wget "$ROUTEROS_PATH" -O "/routeros/${ROUTEROS_IMAGE}.zip" && \ - unzip "/routeros/${ROUTEROS_IMAGE}.zip" -d "/routeros" && \ - rm -f "/routeros/${ROUTEROS_IMAGE}.zip" +RUN wget "$ROUTEROS_PATH" -O "/routeros_source/${ROUTEROS_IMAGE}.zip" && \ + unzip "/routeros_source/${ROUTEROS_IMAGE}.zip" -d "/routeros_source" && \ + rm -f "/routeros_source/${ROUTEROS_IMAGE}.zip" # Copy script to routeros folder -ADD ["./scripts", "/routeros"] +ADD ["./scripts", "/routeros_source"] -ENTRYPOINT ["/routeros/entrypoint.sh"] +ENTRYPOINT ["/routeros_source/entrypoint.sh"] diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 7240d84..12bb7b4 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,5 +1,13 @@ #!/usr/bin/env bash +if [[ ! -e "/routeros/generate-dhcpd-conf.py" ]]; then + + cp -r /routeros_source/. /routeros +fi + + +cd /routeros + QEMU_BRIDGE_ETH1='qemubr1' default_dev1='eth0'