Running Webhook Relay agent with Podman

By Karolis Rusenas · Jun 22, 2020

Webhooks

If you are familiar with Docker, you probably have also heard about Podman. Podman doesn’t try to do many things that Docker does, it’s a daemonless tool that provides an easy way to run, find and build OCI containers. We are happy to include documentation on how to run Webhook Relay tunnelling agent with Podman and also to announce that we are now providing agent images that are built on top of Redhat’s Universal Base Image (UBI).

Getting started

First, get a token key & secret pair from https://my.webhookrelay.com/tokens. Once you got it, to launch a container via Podman we will be using our ubi8 based image webhookrelay/webhookrelayd-ubi8:latest.

Podman has very similar run syntax to Docker’s so you will probably feel right at home if you have used Docker before:

podman run -it docker.io/library/busybox

You can find “podman run” command docs here. From that page let’s look at environment variable configuration as we will need to supply access token and secret:

podman run -d --env RELAY_KEY=your-token-key --env RELAY_SECRET=your-token-secret --env BUCKETS=your-bucket-name --network host webhookrelay/webhookrelayd-ubi8

Here we also added:

  • –env BUCKETS=your-bucket-name - a comma separated list of buckets to forward
  • –env RELAY_KEY=your-access-token-key - access token key (get key & secret pair from the tokens page)
  • –env RELAY_SECRET=your-access-token-secret - access token secret
  • -d - ‘detach’, this allows container to be started in a background
  • –network host - this is only needed for localhost (as our test server was running on the same machine). In a normal setup Webhook Relay agent would be started anywhere in the internal network and forward webhooks based on either internal DNS or IP addresses, therefore this flag wouldn’t be needed. Also, if it’s sending requests to some other container avoid host network.

Now, we can check whether the container is running:

podman ps
CONTAINER ID  IMAGE                                             COMMAND  CREATED             STATUS                 PORTS  NAMES
<container ID>  docker.io/webhookrelay/webhookrelayd-ubi8:latest           About a minute ago  Up About a minute ago         gallant_bardeen

To view container logs:

podman logs <container ID>
2020-05-31 21:26:43.267    INFO    using standard transport...
2020-05-31 21:26:43.356    INFO    webhook relay ready...    {"host": "my.webhookrelay.com:8080", "buckets": ["podman-test"]}

That’s it, to remove container once you are done:

podman rm <container ID> -f