diff --git a/a.out b/a.out deleted file mode 100755 index 80722d4a..00000000 Binary files a/a.out and /dev/null differ diff --git a/docker/Dockerfile b/docker/Dockerfile old mode 100644 new mode 100755 index 8a3954bf..ec8594c7 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,14 +9,16 @@ FROM debian:bookworm AS aqualinkd-build #VOLUME ["/aqualinkd-build"] RUN apt-get update && \ - apt-get -y install build-essential libsystemd-dev + apt-get -y install curl make gcc libsystemd-dev # Seup working dir RUN mkdir /home/AqualinkD WORKDIR /home/AqualinkD +ARG AQUALINKD_VERSION +RUN curl -sL "https://github.com/sfeakes/AqualinkD/archive/refs/tags/$AQUALINKD_VERSION.tar.gz" | tar xz --strip-components=1 # Get latest release -RUN curl -sL $(curl -s https://api.github.com/repos/sfeakes/AqualinkD/releases/latest | grep "tarball_url" | cut -d'"' -f4) | tar xz --strip-components=1 +#RUN curl -sL $(curl -s https://api.github.com/repos/sfeakes/AqualinkD/releases/latest | grep "tarball_url" | cut -d'"' -f4) | tar xz --strip-components=1 # Build aqualinkd RUN make clean && \ @@ -30,10 +32,10 @@ RUN make clean && \ FROM debian:bookworm-slim AS aqualinkd -#ARG AQUALINKD_VERSION +ARG AQUALINKD_VERSION RUN apt-get update && \ - apt-get install -y cron curl && \ + apt-get install -y cron curl socat && \ apt-get clean # Set cron to read local.d @@ -46,14 +48,16 @@ LABEL org.opencontainers.image.title="AqualinkD" LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/sfeakes/aqualinkd/general" LABEL org.opencontainers.image.source="https://github.com/sfeakes/AqualinkD" LABEL org.opencontainers.image.documentation="https://github.com/sfeakes/AqualinkD" -#LABEL org.opencontainers.image.version=$AQUALINKD_VERSION +LABEL org.opencontainers.image.version=$AQUALINKD_VERSION COPY --from=aqualinkd-build /home/AqualinkD/release/aqualinkd /usr/local/bin/aqualinkd COPY --from=aqualinkd-build /home/AqualinkD/release/serial_logger /usr/local/bin/serial_logger COPY --from=aqualinkd-build /home/AqualinkD/web/ /var/www/aqualinkd/ COPY --from=aqualinkd-build /home/AqualinkD/release/aqualinkd.conf /etc/aqualinkd.conf + #COPY --from=aqualinkd-build /home/AqualinkD/docker/aqualinkd-docker.cmd /usr/local/bin/aqualinkd-docker -RUN curl -s -o /usr/local/bin/aqualinkd-docker https://raw.githubusercontent.com/sfeakes/AqualinkD/master/extras/aqualinkd-docker.cmd +RUN curl -s -o /usr/local/bin/aqualinkd-docker https://raw.githubusercontent.com/sfeakes/AqualinkD/master/docker/aqualinkd-docker.cmd && \ + chmod +x /usr/local/bin/aqualinkd-docker CMD ["sh", "-c", "/usr/local/bin/aqualinkd-docker"] diff --git a/docker/aqexec-pre.sh b/docker/aqexec-pre.sh new file mode 100644 index 00000000..f9532fdb --- /dev/null +++ b/docker/aqexec-pre.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Example file that will start SOCAT before AqualinkD in a docker +# to support EW-11 WIFI module for RS485 connection +# +# This file should be placed in the config aqualinkd directory defined +# in your docker-compose.yml (or equiv) +# +# MAKE SURE TO CHAGE THE IP BELOW +# + +echo "Starting SOCAT port binding....." +socat -d -d pty,link=/dev/tty.Pool2,raw TCP:192.168.99.248:8899 & +echo "Sleeping for SOCAT start....." +sleep 2s \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml old mode 100644 new mode 100755 index 81e8dbc0..55d55b64 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,12 @@ services: aqualinkd: #image: sfeakes/aqualinkd:latest build: - context: https://github.com/sfeakes/AqualinkD.git#main:docker + context: https://github.com/sfeakes/AqualinkD.git#master:docker + args: + AQUALINKD_VERSION: v2.3.6 # Make sure to change to correct version + tags: + - aqualinkd:v2.3.6 + container_name: aqualinkd ports: - "6171:80" volumes: