Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
queeup committed Jul 10, 2023
0 parents commit 3abbf72
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/container_build_and_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub-and-github-packages
name: Publish Container image

on:
push:
tags:
- 'v*'
paths:
- '**Containerfile**'
workflow_dispatch:

jobs:
push_to_registries:
name: Push Container image to multiple registries
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm/8,linux/arm/7,linux/arm/6

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

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64,linux/arm/8,linux/arm/7,linux/arm/6
context: .
file: Containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
11 changes: 11 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG ALPINE_VERSION=3.18

FROM alpine:${ALPINE_VERSION} as build
ARG MINIUPNPC_VERSION=2.2.4-r0
RUN apk add --no-cache miniupnpc=${MINIUPNPC_VERSION}

FROM scratch
COPY --from=build /usr/bin/upnpc /bin/
COPY --from=build /usr/lib/libminiupnpc.so.* /lib/ld-musl-*.so.1 /lib/

ENTRYPOINT ["/bin/upnpc"]
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# miniupnpc in a container

## Tags

- `latest`: latest upnpc binary on top of [scratch](https://hub.docker.com/_/scratch) image
- `v2.2.4-r0`: you can choose specific version of upnpc

## Pull

```bash
podman pull docker.io/queeup/upnpc-container

# OR

podman pull ghcr.io/queeup/upnpc-container
```

## Use

```bash
podman run \
--rm \
--interactive \
--tty \
--network host \
upnpc-container --help
```

## Build

```bash
podman build -t upnpc-container --file Containerfile
```

[Containerfile is here](https://github.com/queeup/upnpc-container/blob/main/Containerfile)

0 comments on commit 3abbf72

Please sign in to comment.