Minimal demo of building an application for an IP camera with a Linux cross-compilation environment.
The repository intentionally mirrors the production build flow in a reduced form:
- The build environment provides a cross-compiler.
- Docker calls the cross-compiler.
- The build produces a target Linux binary.
The demo application is a tiny HTTP server. It listens on port 8080 by
default and returns HTTP 200 OK for every accepted TCP connection.
Build the demo app:
makeBy default, Docker uses the standard Ubuntu ARM cross compiler:
arm-linux-gnueabi-gcc
The output file is:
build/http_200
To build with a local toolchain archive, keep the archive in the repository
directory and pass it as TOOLCHAIN:
make TOOLCHAIN=toolchain.tgzTo only build the Docker image:
make docker-buildTo copy the binary from the image:
make docker-artifactThe default toolchain prefix is arm-linux-. For a toolchain with another
prefix, pass it explicitly:
make TOOLCHAIN=toolchain.tgz TOOLCHAIN_PREFIX=vendor-linux-To find the prefix, list compiler binaries in the archive:
tar -tf toolchain.tgz | grep '/bin/.*gcc$'For example, if the compiler is bin/vendor-linux-gcc, use
TOOLCHAIN_PREFIX=vendor-linux-.
Copy build/http_200 to the camera and run it:
./http_200 8080Then request any path:
curl http://CAMERA_IP:8080/The expected response is:
OK