Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support #7

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update workflow for arm64 and amd64 images, support custom certs at r…
…untime, provide docker-compose support
gmarzot committed Nov 12, 2024
commit 5b804ed2037fad51d6c7a11caee4754821bf8a2d
6 changes: 6 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -25,6 +25,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# This step is required for multi-arch builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

@@ -53,6 +57,8 @@ jobs:
with:
context: .
file: docker/Dockerfile
# This line specifies the architectures to build for
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
34 changes: 33 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
# docker/Dockerfile
# Dockerfile for building the Moq Relay Server
#
# docker build -t moqrelay -f docker/Dockerfile .
#
# To run the container:
#
# Using default values (port 4433, logging DBG)
# docker run --rm -p 4433:4433 moqrelay
#
gmarzot marked this conversation as resolved.
Show resolved Hide resolved
# Override logging level
# docker run --rm -p 4433:4433 -e MOQ_LOG_LEVEL=INFO moqrelay
#

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be helpful (for non-Meta folks) to include a description of how this project uses the available log levels.

Copy link
Contributor Author

@gmarzot gmarzot Nov 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks this is folly XLOG and the levels in use are: ERR, WARN, INFO, and DBG1-6 (for increasing levels of trace) . however I can't see the '--logging' flag having any effect. it is possible to set the following env vars and get richer output:

GLOG_minloglevel=0 GLOG_v=6 GLOG_logtostderr=1 ./_build/bin/moqrelayserver -port 4433 -cert ./certs/certificate.pem -key ./certs/certificate.key -endpoint "/moq"

@afrind am i seeing this right - suspect some logging init/flag processing code is needed?

# Override both port and logging
# docker run --rm -p 8080:8080 -e MOQ_PORT=8080 -e MOQ_LOG_LEVEL=INFO moqrelay
#
# Using certs from a specific host directory
# docker run --rm -p 4433:4433 \
# -v /path/to/your/certs:/certs \
# moqrelay
#
# Using individual cert files with different names
# docker run --rm -p 4433:4433 \
# -v /path/to/custom.pem:/certs/certificate.pem \
# -v /path/to/custom.key:/certs/certificate.key \
# moqrelay
#
# # Using completely custom paths with environment variables
# docker run --rm -p 4433:4433 \
# -v /path/to/certs:/custom/certs \
# -e CERT_FILE=/custom/certs/my-cert.pem \
# -e KEY_FILE=/custom/certs/my-key.key \
# moqrelay
#
FROM ubuntu:latest

# Install essential build tools and dependencies
Empty file added docker/docker-compose.yml
Empty file.