# Build a Docker Image

FlyDog SDR runs in Docker, so you need to build a Docker image.

# Build the Development Environment

To build a Docker image for FlyDog SDR, you will need to operate in an armv7l architecture or use Docker Buildx for cross-platform builds (not recommended and currently requires Docker experimental features to be enabled).

# Installing Docker

The processor architecture is checked and the architecture needs to be armv7l.

[[email protected]: ~]$ uname -m
armv7l

Automate the installation using Docker-related installation scripts.

[[email protected] ~]$ sudo curl -o /tmp/get-docker.sh https://get.docker.com
[[email protected] ~]$ sudo chmod +x /tmp/get-docker.sh
[[email protected] ~]$ sudo sh -c /tmp/get-docker.sh

For mainland China, you can add the -mirror AzureChinaCloud parameter when installing Docker.

[[email protected] ~]$ sudo sh -c /tmp/get-docker.sh --mirror AzureChinaCloud

Once the installation is complete, add the current user to the Docker usergroup docker and reboot.

[fds[email protected] ~]$ sudo usermod -aG docker ${USER}
[[email protected] ~]$ sudo systemctl enable docker
[[email protected] ~]$ sudo reboot

# Pulling Base Images

FlyDog SDR is built using Bebian Buster as the base image.

Pull debian:buster-slim from DockerHub.

[[email protected] ~]$ docker pull debian:buster-slim

For mainland China, you can use Aliyun's Docker image accelerator when pulling base images.

[[email protected] ~]$ docker pull flydog-sdr.mirror.aliyuncs.com/library/debian:buster-slim
[[email protected] ~]$ docker tag flydog-sdr.mirror.aliyuncs.com/library/debian:cluster-slim debian:cluster-slim
[[email protected] ~]$ docker image rm flydog-sdr.mirror.aliyuncs.com/library/debian:cluster-slim

# Build the Image

Use Git to get the Dockerfile for FlyDog SDR.

[[email protected] ~]$ git clone https://github.com/flydog-sdr/docker-builder

For mainland China, you can use the GitHub mirror (github.com.cnpmjs.org) to pull it.

[[email protected] ~]$ git clone https://github.com.cnpmjs.org/flydog-sdr/docker-builder

Go to the flydog-sdr directory and modify the relevant environment variables in the Dockerfile as appropriate.

[[email protected] ~]$ cd docker-builder/flydog-sdr
[[email protected] flydog-sdr]$ vim Dockerfile
ENV Description
GIT_BRANCH Specify a Git branch
GIT_HOST Specify the Git hostname
GIT_USER Specify the username for the repository
REPO_NANE Specify the repository name

When you're done, start building the main application and it will take about 15 minutes to complete the build.

[[email protected] flydog-sdr]$ docker build --no-cache -t flydog-sdr:latest .