Minor tweaks

master
Mark 2025-01-18 10:46:47 -08:00
parent 38966e4a63
commit 414b05fb22
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
3 changed files with 11 additions and 12 deletions

View File

@ -8,9 +8,9 @@ RUN apt-get update --yes && \
apt-get upgrade --yes && \ apt-get upgrade --yes && \
apt-get install --yes --no-install-recommends \ apt-get install --yes --no-install-recommends \
bash \ bash \
#tini \
locales \ locales \
iptables \ iptables \
dnsutils \
&& \ && \
# Clean up and generate locales # Clean up and generate locales
apt-get clean && rm -rf /var/lib/apt/lists/* && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \
@ -27,7 +27,6 @@ EXPOSE 587
COPY start.sh /start.sh COPY start.sh /start.sh
COPY iptables.sh /iptables.sh COPY iptables.sh /iptables.sh
#ENTRYPOINT ["tini", "-g", "--"]
ENTRYPOINT ["bash"] ENTRYPOINT ["bash"]
CMD ["start.sh"] CMD ["/start.sh"]

View File

@ -1,21 +1,21 @@
nat () { nat () {
# All traffic to $THIS_PORT on this container # All traffic to $THIS_PORT on this container
# will be redirected to $THAT_PORT on $THAT_IP # will be redirected to $THAT_PORT on $THAT_IP
$THAT_IP=$1 THAT_IP=$1
THIS_PORT=$2 THIS_PORT=$2
THAT_PORT=$3 THAT_PORT=$3
# Accept forward incoming traffic # Accept forward incoming traffic
iptables -I FORWARD -d $FWD_IP -m tcp -p tcp --dport $THAT_PORT -j ACCEPT iptables -I FORWARD -d $THAT_IP -m tcp -p tcp --dport $THAT_PORT -j ACCEPT
# Accept forward return traffic # Accept forward return traffic
iptables -I FORWARD -s $FWD_IP -m tcp -p tcp --sport $THAT_PORT -j ACCEPT iptables -I FORWARD -s $THAT_IP -m tcp -p tcp --sport $THAT_PORT -j ACCEPT
# Redirect packets to remote # Redirect packets to remote
iptables -t nat -I PREROUTING -m tcp -p tcp --dport $THIS_PORT -j DNAT --to-destination $THAT_IP:$THAT_PORT iptables -t nat -I PREROUTING -m tcp -p tcp --dport $THIS_PORT -j DNAT --to-destination $THAT_IP:$THAT_PORT
} }
NAT_IP=10.143.0.20 NAT_IP=$(dig +short betalupi.com)
nat $NAT_IP 33 10013 nat $NAT_IP 33 10013
nat $NAT_IP 993 10015 nat $NAT_IP 993 10015
nat $NAT_IP 587 10016 nat $NAT_IP 587 10016
@ -25,4 +25,4 @@ nat $NAT_IP 587 10016
# Include this line ONCE, at the end. # Include this line ONCE, at the end.
iptables -t nat -I POSTROUTING -d $FWD_IP -j MASQUERADE iptables -t nat -I POSTROUTING -d $NAT_IP -j MASQUERADE

View File

@ -53,9 +53,9 @@ printf "Done. \n\n"
build_image octave #build_image octave
build_image r #build_image r
build_image julia #build_image julia
#build_image sage (BROKEN) #build_image sage (BROKEN)
build_image plugins build_image plugins
@ -68,7 +68,7 @@ build_image pymodules
# Rename final image # Rename final image
docker image tag betalupi/jupyter-inter-(math $img_idx) git.betalupi.com/mark/jupyter docker image tag betalupi/jupyter-inter-(math $img_idx) git.betalupi.com/mark/jupyter_small
docker image rm betalupi/jupyter-inter-(math $img_idx) docker image rm betalupi/jupyter-inter-(math $img_idx)
echo "" echo ""