first version of docker support
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
(cd buildenv && docker build -t ebusd-buildenv .)
|
||||||
|
docker run --rm -it -v `pwd`/../..:/build ebusd-buildenv ./make_debian.sh
|
||||||
|
export EBUSD_VERSION=`cat ../../VERSION`
|
||||||
|
export EBUSD_ARCH=`docker version|grep -i "Arch[^:]*server"|head -n 1|sed -e 's#^.*/##'`
|
||||||
|
cp -a ../../ebusd-${EBUSD_VERSION}_${EBUSD_ARCH}.deb runtime/
|
||||||
|
(cd runtime && docker build -t ebusd .)
|
||||||
|
echo "docker image created."
|
||||||
|
echo
|
||||||
|
echo "to run it interactively on serial device /dev/ttyUSB1:"
|
||||||
|
echo "docker run --rm -it --device=/dev/ttyUSB1:/dev/ttyUSB0 -p 127.0.0.1:8888:8888 ebusd"
|
||||||
|
echo
|
||||||
|
echo "to start it in background on serial device /dev/ttyUSB1:"
|
||||||
|
echo "docker run device=/dev/ttyUSB1:/dev/ttyUSB0 -p 127.0.0.1:8888:8888 ebusd"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
FROM debian
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y git autoconf automake g++ make
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
CMD ["/bin/bash"]
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
FROM debian
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y curl
|
||||||
|
|
||||||
|
LABEL maintainer "ebusd@ebusd.eu"
|
||||||
|
|
||||||
|
RUN mkdir /etc/ebusd \
|
||||||
|
&& curl -SL https://github.com/john30/ebusd-configuration/archive/master.tar.gz \
|
||||||
|
| tar xz --strip-components=3 -C /etc/ebusd ebusd-configuration-master/ebusd-2.1.x/de
|
||||||
|
|
||||||
|
ENV EBUSD_VERSION 3.0pre
|
||||||
|
ENV EBUSD_ARCH amd64
|
||||||
|
COPY ebusd-${EBUSD_VERSION}_${EBUSD_ARCH}.deb ebusd.deb
|
||||||
|
|
||||||
|
RUN dpkg -i ebusd.deb
|
||||||
|
|
||||||
|
EXPOSE 8888
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["-f", "--scanconfig"]
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "${1#-}" != "$1" ]; then
|
||||||
|
set -- ebusd "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
export EBUSD_VERSION=`cat ../../VERSION`
|
||||||
|
export EBUSD_ARCH=`docker version|grep -i "Arch[^:]*server"|head -n 1|sed -e 's#^.*/##'`
|
||||||
|
sed -i -e "s#^ENV EBUSD_VERSION .*\$#ENV EBUSD_VERSION ${EBUSD_VERSION}#" -e "s#^ENV EBUSD_ARCH .*\$#ENV EBUSD_ARCH ${EBUSD_ARCH}#" runtime/Dockerfile
|
||||||
Reference in New Issue
Block a user