Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile to build docker container #52

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Download base image ubuntu 22.04
FROM ubuntu:22.04

# LABEL about the custom image
LABEL description="ADS-B to TAK Gateway."

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive

# Update Ubuntu Software repository
RUN apt update
RUN apt upgrade -y
RUN apt install -y python3
RUN apt install -y python3-pip
RUN apt install -y python3-numpy
RUN apt install -y python3-zmq
RUN apt install -y python3-cryptography
RUN apt install -y rtl-sdr

# Install Python modules
RUN python3 -m pip install asyncinotify
RUN python3 -m pip install pymodes
RUN python3 -m pip install pyrtlsdr

# Build adsbcot
COPY . /adsbcot/
RUN cd /adsbcot/ && python3 setup.py install easy_install 'adsbcot[with_pymodes]'
RUN rm -R /adsbcot/

# Copy adsbcot configuration
RUN mkdir /etc/adsbcot/
COPY adsbcot-docker-example.conf /etc/adsbcot/adsbcot.conf

# Copy start.sh script and define default command for the container
COPY start.sh /start.sh
CMD ["./start.sh"]
10 changes: 10 additions & 0 deletions adsbcot-docker-example.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[adsbcot]
COT_URL = tls://tak.example.com:8089
PYTAK_TLS_CLIENT_CERT = /etc/adsbcot/adsbcot.pem
PYTAK_TLS_CLIENT_KEY = /etc/adsbcot/adsbcot.key
PYTAK_TLS_CLIENT_PASSWORD = atakatak
PYTAK_TLS_CLIENT_CAFILE = /etc/adsbcot/adsbcot-trusted.pem
PYTAK_TLS_DONT_CHECK_HOSTNAME = 1
FEED_URL = http://local.pi/tar1090/data/aircraft.json
POLL_INTERVAL = 5
INCLUDE_TISB = true
16 changes: 16 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ sudo apt install -y python3-pip
sudo python3 -m pip install adsbcot
```

## Docker

Build the docker container.

```sh linenums="1"
git clone https://github.com/snstac/adsbcot.git
cd adsbcot/
docker build -t adsbcot .
```

Run the docker container with config folder mounted locally. Config files can be edited in the local folder ```/opt/docker/adsbcot/```.

```sh linenums="1"
docker run -d -v /opt/docker/adsbcot/:/etc/adsbcot --name adsbcot adsbcot
```

## Developers

PRs welcome!
Expand Down
2 changes: 2 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
/usr/local/bin/adsbcot -c /etc/adsbcot/adsbcot.conf