-
Build the development image:
docker build -f Dockerfile.dev -t media_processing_dev .Or using docker-compose:
docker-compose -f docker-compose.dev.yml build
# Start the container
docker-compose -f docker-compose.dev.yml up -d
# Enter the container
docker exec -it media_processing_dev /bin/bash
# Inside the container, build your project
mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_BUILD_TYPE=Debug ..
make -j$(nproc)
# Run your application
./processing_service_backup
# When done, stop the container
docker-compose -f docker-compose.dev.yml down# Run the container with volume mount
docker run -it --rm \
--name media_processing_dev \
-v "${PWD}:/app" \
-p 5555:5555 \
media_processing_dev
# Inside the container, build and run as above- Your source code is mounted - any changes you make on your host machine are immediately visible in the container
- Rebuild when needed - after changing code, just run
makein the/app/builddirectory - Generate Avro schemas - if you modify schemas:
avrogencpp -i schemas/mediaProcessingSchema.avsc -o schemas/generated/MediaProcessingJob.hh -n xyz::virajdoshi::reelz
When ready for production, use the optimized Dockerfile:
docker build -t media_processing .
docker run --name mediaProcessingService -it --rm -p 5555:5555 media_processing