Repository: vi/websocat (language: rust)

Issue:
Hope to provide the official docker image
I've searched from https://hub.docker.com/search?q=websocat, but can't find an official docker image.

It would be helpful to have a github packages or dockerhub image to use this tool.


Discussion / hints:
I remember somebody contributing a [Dockerfile for Websocat](https://github.com/vi/websocat/blob/master/Dockerfile). Does it still work? (I don't use it myself).
It broken but I can create a pull request to fixed it. If the build works, is it possible to add a github action to automatically generate an official docker image?
Websocat does not currently use a CI (there was previously a travis-ci.org for checking commits, but now it is defunct). I typically build release artifacts on my laptop and build environment may be different each time.

Build reproducibility is planned for Websocat3. But if you contribute an updated Dockerfile and Github Actions configs for it (I never used myself Github Actions yet) then I will likely use it when creating releases; and pending release of Websocat 1.10.0 with some bugfixes will have a Docker Hub image.
Okay, I would fix Dockerfile first, and then take a look at how the Github Actions work for the rust binary.

There are two options: push docker image to Docker Hub or Github Packages, but additional secrets need to be configured in the project

The example
```yaml
- name: Login to DockerHub
  uses: docker/login-action@v1
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Github Package
  uses: docker/login-action@v1
  with:
    registry: ghcr.io
    username: Dreamacro
    password: ${{ secrets.PACKAGE_TOKEN }}
```
> Docker Hub or Github Packages

What are pros and cons and why not both?
Dockerhub is the most widely used, but due to the commercialization process of Docker.Inc, the free service may be discontinued at some point in the future (It currently has a limit on the number of requests). https://www.docker.com/increase-rate-limits/

As of now, Github has an optimistic attitude towards open source projects, so it's a good idea to use Github Packages as a fallback option.
Uploaded https://github.com/vi/websocat/pkgs/container/websocat and https://hub.docker.com/r/vi0oss/websocat

(manually, without Github Actions yet)

Are them OK?
It works great! But I think it might be necessary to provide some additional OS platforms (like `linux/arm/v6` `linux/arm/v7` and `linux/arm64`).

BTW, Do you still need Github Actions that are built automatically (and can be triggered manually)?
Configuring CI is planned, but maybe not for this release (0.10.0).

I need to educate myself about Github Actions first.
https://github.com/Dreamacro/clash/blob/master/.github/workflows/docker.yml

Here's the Github Actions example I'm using, which requires a small tweak in the Dockerfile for Go, and I don't know if it's needed for Rust
One of hope for this.
@flavono123 What hope?

If you need Docker images for amd64 Websocat you already can use it.

Fix patch:
diff --git a/.github/workflows/container-image-buildah.yml b/.github/workflows/container-image-buildah.yml
new file mode 100644
index 00000000..60f04ce1
--- /dev/null
+++ b/.github/workflows/container-image-buildah.yml
@@ -0,0 +1,100 @@
+name: Container Image
+
+on:
+  workflow_dispatch: {}
+  workflow_call: {}
+  schedule:
+    # every Wednesday morning
+    - cron: 7 7 * * 3
+  push:
+    branches: [ master ]
+    tags:
+      - '*'           # Push events to every tag not containing /
+  pull_request:
+    types: [opened, reopened, synchronize]
+
+concurrency:
+  group: ci-container-build-${{ github.ref }}-1
+  cancel-in-progress: true
+
+env:
+  # Use docker.io for Docker Hub if empty
+  REGISTRY: ghcr.io
+  # github.repository as <account>/<repo>
+  IMAGE_NAME: ${{ github.repository }}
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to ghcr.io
+permissions:
+  contents: read
+  packages: write
+  id-token: write
+
+jobs:
+  buildah:
+    runs-on: ubuntu-latest
+    steps:
+      # Allow multi-target builds
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v2
+        with:
+          platforms: arm64
+      # Login against a Docker registry except on PR
+      # https://github.com/docker/login-action
+      - name: Log into registry ${{ env.REGISTRY }}
+        if: github.event_name != 'pull_request'
+        uses: redhat-actions/podman-login@v1
+        with:
+          registry: ${{ env.REGISTRY }}
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+      # Extract metadata (tags, labels) for Docker
+      # https://github.com/docker/metadata-action
+      - name: Docker meta
+        id: meta
+        uses: docker/metadata-action@v4
+        with:
+          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+          tags: |
+            type=schedule
+            type=raw,value=latest,enable=${{ github.ref_name == 'master' }}
+            ${{ github.ref_name == 'master' && 'type=raw,value=nightly' || 'type=ref,event=branch' }}
+            type=ref,event=tag
+            type=ref,event=pr
+
+      # https://github.com/actions/checkout
+      - uses: actions/checkout@v3
+
+      - name: Build image
+        id: build-image
+        uses: redhat-actions/buildah-build@v2
+        with:
+          tags: ${{ steps.meta.outputs.tags }}
+          platforms: linux/amd64
+          labels: ${{ steps.meta.outputs.labels }}
+          layers: false
+          oci: true
+          tls-verify: true
+          extra-args: |
+            --squash
+            --jobs=3
+          containerfiles: |
+            Dockerfile
+
+      - name: Echo Outputs
+        run: |
+          echo "Image: ${{ steps.build-image.outputs.image }}"
+          echo "Tags: ${{ steps.build-image.outputs.tags }}"
+          echo "Tagged Image: ${{ steps.build-image.outputs.image-with-tag }}"
+
+      - name: Check images created
+        run: buildah images
+
+      - name: Push To Container Registry
+        id: push-to-container-registry
+        uses: redhat-actions/push-to-registry@v2
+        if: github.event_name != 'pull_request'
+        with:
+          tags: ${{ steps.build-image.outputs.tags }}
+
+      - name: Print image url
+        run: echo "Image pushed to ${{ steps.push-to-container-registry.outputs.registry-paths }}"


Test patch: