I apologise for my lack of knowledge, still on a steep learning curve with Balena.
I have an ADSB container which runs well on a Raspberry Pi and am trying to create another container with code from GitHub.
For ease, this is how my following files look…
/adsbcot/Dockerfile.template
FROM balenalib/%%BALENA_ARCH%%-debian:buster AS base
LABEL maintainer=""
# GENERAL
ENV GIT_SOURCE="https://github.com/ampledata/adsbcot.git"
ENV GIT_BRANCH="main"
ENV SRC_PATH="/src/adsbcot"
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
ENV RECEIVER_HOST dump1090-fa
ENV RECEIVER_PORT 30005
RUN apt-get update && \
apt-get install -y \
curl \
python \
python3 \
build-essential \
python-dev \
python3-pip \
git \
libatlas-base-dev \
libpcap-dev && apt-get clean
RUN mkdir /src && mkdir -p /usr/share/adsbcot
RUN git clone -b ${GIT_BRANCH} --depth 1 ${GIT_SOURCE} ${SRC_PATH}
COPY start.sh /
RUN chmod +x /start.sh
ENTRYPOINT ["/start.sh"]
/adsbcot/start.sh
#!/usr/bin/env bash
set -e
# Check if service has been disabled through the DISABLED_SERVICES environment variable.
if [[ ",$(echo -e "${DISABLED_SERVICES}" | tr -d '[:space:]')," = *",$BALENA_SERVICE_NAME,"* ]]; then
echo "$BALENA_SERVICE_NAME is manually disabled."
sleep infinity
fi
# Verify that all the required varibles are set before starting up the application.
echo "Verifying settings..."
echo " "
sleep 2
missing_variables=false
echo " "
if [ "$missing_variables" = true ]
then
echo "Settings missing, aborting..."
echo " "
sleep infinity
fi
echo "Settings verified, proceeding with startup."
echo " "
# Start adsbcot and put it in the background.
cd /usr/share/adsbcot
adsbcot -U tcp:x.x.x.x:8087 -D tcp+beast:127.0.0.1:30005 &
# Wait for any services to exit.
wait -n
/docker-compose.yml
version: '2'
volumes:
settings:
services:
dump1090-fa:
build: ./dump1090-fa
image: dump1090-fa
restart: always
environment:
- LAT=
- LON=
- ALT=
devices:
- "/dev/bus/usb"
expose:
- "30001"
- "30002"
- "30003"
- "30004"
- "30005"
- "30102"
- "30104"
- "30105"
- "30106"
- "8080"
ports:
- "30001:30001"
- "30002:30002"
- "30003:30003"
- "30004:30004"
- "30005:30005"
- "30102:30102"
- "30104:30104"
- "30105:30105"
- "30106:30106"
- "8080:8080"
piaware:
depends_on:
- dump1090-fa
build: ./piaware
image: piaware
restart: always
environment:
- FLIGHTAWARE_FEEDER_ID=
adsbcot:
depends_on:
- dump1090-fa
build: ./adsbcot
image: adsbcot
restart: always
Essentially, I would like to install / git clone the adsbcot code from Github into a container and then start the code with the command adsbcot -U tcp:x.x.x.x:8087 -D tcp+beast:127.0.0.1:30005 &
Everything seems to build correctly, however the container isn’t running and I get the error…
adsbcot Verifying settings...
adsbcot
adsbcot
adsbcot Settings verified, proceeding with startup.
adsbcot
adsbcot /start.sh: line 68: adsbcot: command not found
Can anyone assist where I may be going wrong please, I am hoping it is a simple solution.
Many thanks.