Skip to content

Commit cc43d87

Browse files
committed
Intial commit
0 parents  commit cc43d87

5 files changed

Lines changed: 99 additions & 0 deletions

File tree

.github/workflows/build-docker.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
3+
name: Docker Build & Publish to GitHub Container Registry
4+
on:
5+
push:
6+
branches:
7+
- 'main'
8+
tags:
9+
- 'v*'
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: stackhpc/tang
13+
jobs:
14+
build-and-push-docker-image:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Log into registry ${{ env.REGISTRY }}
19+
uses: docker/login-action@v1
20+
with:
21+
registry: ${{ env.REGISTRY }}
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Setup Docker buildx
25+
uses: docker/setup-buildx-action@v1
26+
- name: Extract Docker metadata
27+
id: meta
28+
uses: docker/metadata-action@v2
29+
with:
30+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
31+
- name: Build and Push Versioned Docker Image
32+
id: build-and-push
33+
uses: docker/build-push-action@v2
34+
if: ${{ github.ref_type == 'tag' }}
35+
with:
36+
context: .
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}
40+
- name: Build and Push Latest Docker Image
41+
id: build-and-push-latest
42+
uses: docker/build-push-action@v2
43+
if: ${{ github.ref == 'refs/heads/main' }}
44+
with:
45+
context: .
46+
push: true
47+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
48+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM rockylinux/rockylinux:8.6.20220707
2+
3+
ENV SUMMARY="Network Presence Binding Daemon." \
4+
DESCRIPTION="Tang is a small daemon for binding data to the presence of a third party. This is a containerized Tang server." \
5+
VERSION=1 \
6+
TANG_LISTEN_PORT=80
7+
8+
LABEL name="stackhpc/tang" \
9+
summary="${SUMMARY}" \
10+
description="${DESCRIPTION}" \
11+
version="${VERSION}" \
12+
usage="podman run -d -p 8080:80 -v tang-keys:/var/db/tang --name tang stackhpc/tang"
13+
14+
RUN dnf update -y && \
15+
dnf install -y \
16+
tang \
17+
socat && \
18+
dnf clean all && \
19+
rm -rf /var/cache/yum
20+
21+
COPY root /
22+
23+
VOLUME ["/var/db/tang"]
24+
EXPOSE "${TANG_LISTEN_PORT}"
25+
26+
HEALTHCHECK CMD ["/usr/bin/tangd-healthcheck"]
27+
CMD ["/usr/bin/tangd-entrypoint"]

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Tang docker container image
2+
3+
Runs (tang)[https://github.com/latchset/tang] inside a Rocky Linux docker container.
4+
5+
## Usage
6+
7+
```
8+
docker run -d -p 8080:80 -v tang-db:/var/db/tang stackhpc/tang
9+
```

root/usr/bin/tangd-entrypoint

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e
3+
4+
TANG_LISTEN_PORT=${TANG_LISTEN_PORT:-80}
5+
6+
mkdir -p /var/db/tang /var/cache/tang
7+
8+
socat tcp-l:$TANG_LISTEN_PORT,reuseaddr,fork exec:"/usr/libexec/tangd /var/cache/tang"

root/usr/bin/tangd-healthcheck

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
TANG_LISTEN_PORT=${TANG_LISTEN_PORT:-80}
6+
7+
tang-show-keys $TANG_LISTEN_PORT

0 commit comments

Comments
 (0)