Hi. I’m new to Docker and have got a Django app up and running without too much issue. The bit im now stuck on and cant find many answers on is how I would include android Debug Bridge (ADB) with it.
So, just for context. I have a Django app that runs on a Raspberry Pi in kiosk mode and it then connects via ADB to several Android Tablets which it can then run certain adb commands via the django app.
Where im stuck is, when I run the docker-compose file I presume i’d need to install ADB and then get it to run so that the Django app can then utilise the adb commands. Thats where I get stuck, how would i install that with docker and then get it to run?
Heres what I have currently::
docker-compose.yaml
version: '3'
services:
web:
build: .
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
container_name: affinity-manager
volumes:
- .:/affinity-manager
ports:
- "8000:8000"
Docker
# The first instruction is what image we want to base our container on
# We Use an official Python runtime as a parent image
FROM python:3.9
# The enviroment variable ensures that the python output is set straight
# to the terminal with out buffering it first
ENV PYTHONUNBUFFERED 1
# create root directory for our project in the container
RUN mkdir /affinity-manager
# Set the working directory to /music_service
WORKDIR /affinity-manager
# Copy the current directory contents into the container at /music_service
ADD . /affinity-manager/
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
RUN apt-get -y update
RUN apt-get install -y android-tools-adb
# Expose default ADB port
EXPOSE 5037
# Set up PATH
ENV PATH $PATH:/opt/platform-tools
# Start the server by default
CMD ["adb", "start-server"]