This repository contains minimal example of a WebAPI built with C++ and complete Docker CI/CD support via GitHub actions and DockerHub.
- Multi-Platfrom support with Docker via
Buildx
/docker/setup-buildx-action
anddocker/build-push-action
- In this example, we support
linux-x86_64
andlinux-arm64
, but other options are possible as well. To see the list of available platforms, look at the output ofdocker/setup-buildx-action
anddocker/setup-qemu-action
in the GitHub action log. Example output:linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
- In this example, we support
- Multi-Stage build to achieve minimal application (Docker image) size
- Automatic CI/CD pipeline with GitHub actions
- Cache Docker builds with GitHub actions
- Automatic upload to DockerHub
You need to specify two GitHub Secrets in your project settings after cloning the repository:
DOCKERHUB_USERNAME
: your DockerHub user nameDOCKERHUB_TOKEN
: a DockerHub access token (to create one, go to DockerHub Account settings, Security, Access Tokens)
Adjust the docker-ci.yml
and docker-cd.yml
and the Dockerfile
. Add your own code and configure/build instructions.