FROM resin/rpi-raspbian

RUN apt update

RUN apt install -y wget build-essential

RUN wget http://www.dest-unreach.org/socat/download/socat-1.7.3.2.tar.gz

RUN tar zxf socat-1.7.3.2.tar.gz

WORKDIR socat-1.7.3.2

RUN ./configure

RUN make

RUN make install

ENV TZ=Asia/Taipei

CMD socat tcp-listen:${LOCAL_PORT},reuseaddr,fork tcp:${REMOTE_IP}:${REMOTE_PORT}