diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..bdee4e8 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,53 @@ +name: Docker build & publish + +on: + push: + branches: + - main + tags: + - "*" + +env: + REGISTRY: ghcr.io + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Define metadata (tags) for Docker + id: meta + run: | + TAG="latest" + if [ "${{ github.ref_type }}" == "tag" ]; then + TAG=${{ github.ref_name }} + fi + echo "tag=$TAG" >> $GITHUB_OUTPUT + - name: Build and push Docker server image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/media-gateway-server:${{ steps.meta.outputs.tag}} + build-args: | + TYPE=server + - name: Build and push Docker client image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/media-gateway-client:${{ steps.meta.outputs.tag}} + build-args: | + TYPE=client diff --git a/README.md b/README.md index fcd513c..3e103ec 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,6 @@ Both server and client can be run as Docker containers. ### Server -To build Docker image for the server - -```bash -docker build --build-arg="TYPE=server" -t media-gateway-server:latest . -``` - To run the server with [the default configuration](samples/server/default_config.json) and to mount `/tmp` directory and publish the port from the default configuration @@ -56,7 +50,7 @@ publish the port from the default configuration docker run \ -v /tmp:/tmp \ -p 8080:8080 \ - media-gateway-server:latest + ghcr.io/insight-platform/media-gateway-server:latest ``` To run the server with another configuration (`/home/user/server_config.json`) @@ -65,25 +59,19 @@ To run the server with another configuration (`/home/user/server_config.json`) docker run \ -v /home/user/server_config.json:/opt/etc/custom_config.json \ -p HOST_PORT:CONFIG_PORT \ - media-gateway-server:latest \ + ghcr.io/insight-platform/media-gateway-server:latest \ /opt/etc/custom_config.json ``` ### Client -To build Docker image for the client - -```bash -docker build --build-arg="TYPE=client" -t media-gateway-client:latest . -``` - To run the client with [the default configuration](samples/client/default_config.json) and to mount `/tmp` directory ```bash docker run \ -v /tmp:/tmp \ -e "GATEWAY_URL=" \ - media-gateway-client:latest + ghcr.io/insight-platform/media-gateway-client:latest ``` where `` is the server URL, e.g. `http://192.168.0.100:8080` @@ -93,6 +81,6 @@ To run the server with another configuration (`/home/user/client_config.json`) ```bash docker run \ -v /home/user/client_config.json:/opt/etc/custom_config.json \ - media-gateway-client:latest \ + ghcr.io/insight-platform/media-gateway-client:latest \ /opt/etc/custom_config.json ``` diff --git a/benches/README.md b/benches/README.md new file mode 100644 index 0000000..40a0761 --- /dev/null +++ b/benches/README.md @@ -0,0 +1,20 @@ +# Benchmarking + +Benchmark tests use Docker images built locally from sources. + +## Server + +To build Docker image for the server + +```bash +docker build --build-arg="TYPE=server" -t media-gateway-server:latest . +``` + +## Client + +To build Docker image for the client + +```bash +docker build --build-arg="TYPE=client" -t media-gateway-client:latest . +``` +