Skip to content

Commit

Permalink
initial commit - moved from https://github.com/brettinternet/homelab
Browse files Browse the repository at this point in the history
  • Loading branch information
brettinternet committed Dec 10, 2023
0 parents commit c5e8e17
Show file tree
Hide file tree
Showing 25 changed files with 697 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/publish-bash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and publish bash image

on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- bash/*
- .github/workflows/publish-bash.yaml

env:
DOCKER_USERNAME: brettinternet
IMAGE_NAME: bash
DESCRIPTION: An Alpine image for scripting with bash, curl and git using a dumb-init entrypoint

defaults:
run:
working-directory: ./bash

jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skipci')"
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64,amd64

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

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}

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

- name: Extract image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
flavor: latest=auto
tags: type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./${{ env.IMAGE_NAME }}
file: ./${{ env.IMAGE_NAME }}/Dockerfile
platforms: arm64,amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
org.opencontainers.image.name=${{ env.IMAGE_NAME }}
org.opencontainers.image.source=https://github.com/brettinternet/containers/tree/main/${{ env.IMAGE_NAME }}
org.opencontainers.image.description=${{ env.DESCRIPTION }}
org.opencontainers.image.licenses=MIT
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
repository: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
short-description: ${{ env.DESCRIPTION }}
readme-filepath: ./${{ env.IMAGE_NAME }}/README.md
84 changes: 84 additions & 0 deletions .github/workflows/publish-cgit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and publish cgit image

on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- cgit/*
- .github/workflows/publish-cgit.yaml

env:
DOCKER_USERNAME: brettinternet
IMAGE_NAME: cgit
DESCRIPTION: A git web frontend

defaults:
run:
working-directory: ./cgit

jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skipci')"
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64,amd64

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

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}

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

- name: Extract image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
flavor: latest=auto
tags: type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./${{ env.IMAGE_NAME }}
file: ./${{ env.IMAGE_NAME }}/Dockerfile
platforms: arm64,amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
org.opencontainers.image.name=${{ env.IMAGE_NAME }}
org.opencontainers.image.source=https://github.com/brettinternet/containers/tree/main/${{ env.IMAGE_NAME }}
org.opencontainers.image.description=${{ env.DESCRIPTION }}
org.opencontainers.image.licenses=MIT
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
repository: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
short-description: ${{ env.DESCRIPTION }}
readme-filepath: ./${{ env.IMAGE_NAME }}/README.md
84 changes: 84 additions & 0 deletions .github/workflows/publish-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and publish node image

on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- node/*
- .github/workflows/publish-node.yaml

env:
DOCKER_USERNAME: brettinternet
IMAGE_NAME: node
DESCRIPTION: An Alpine image for scripting with node and git using a dumb-init entrypoint

defaults:
run:
working-directory: ./node

jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skipci')"
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64,amd64

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

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}

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

- name: Extract image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
flavor: latest=auto
tags: type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./${{ env.IMAGE_NAME }}
file: ./${{ env.IMAGE_NAME }}/Dockerfile
platforms: arm64,amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
org.opencontainers.image.name=${{ env.IMAGE_NAME }}
org.opencontainers.image.source=https://github.com/brettinternet/containers/tree/main/${{ env.IMAGE_NAME }}
org.opencontainers.image.description=${{ env.DESCRIPTION }}
org.opencontainers.image.licenses=MIT
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
repository: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
short-description: ${{ env.DESCRIPTION }}
readme-filepath: ./${{ env.IMAGE_NAME }}/README.md
86 changes: 86 additions & 0 deletions .github/workflows/publish-snapraid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages
# TODO: specify package README https://github.com/docker/build-push-action/issues/722
name: Build and publish snapraid image

on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- snapraid/*
- .github/workflows/publish-snapraid.yaml

env:
DOCKER_USERNAME: brettinternet
IMAGE_NAME: snapraid
DESCRIPTION: Snapraid backup program for disk arrays and python script runner for automation

defaults:
run:
working-directory: ./snapraid

jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skipci')"
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64,amd64

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

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}

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

- name: Extract image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
flavor: latest=auto
tags: type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./${{ env.IMAGE_NAME }}
file: ./${{ env.IMAGE_NAME }}/Dockerfile
platforms: arm64,amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
org.opencontainers.image.name=${{ env.IMAGE_NAME }}
org.opencontainers.image.source=https://github.com/brettinternet/containers/tree/main/${{ env.IMAGE_NAME }}
org.opencontainers.image.description=${{ env.DESCRIPTION }}
org.opencontainers.image.licenses=MIT
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
repository: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
short-description: ${{ env.DESCRIPTION }}
readme-filepath: ./${{ env.IMAGE_NAME }}/README.md
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Trash
.DS_Store
Thumbs.db
tmp

# scripts
node_modules
*.log
*.pem
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Containers

Hosted images for my homelab.

See usage in [homelab](https://github.com/brettinternet/homelab) and [provision](https://github.com/brettinternet/provision).
1 change: 1 addition & 0 deletions bash/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
5 changes: 5 additions & 0 deletions bash/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM bash:alpine3.16

RUN apk --update add git curl jq dumb-init

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
3 changes: 3 additions & 0 deletions bash/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Bash

An Alpine image for scripting with bash, curl, jq and git using a dumb-init entrypoint.
1 change: 1 addition & 0 deletions cgit/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
22 changes: 22 additions & 0 deletions cgit/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://wiki.alpinelinux.org/wiki/Cgit
# Alternate option: https://git.causal.agency/cgit-pink/tree/cgit.css
FROM alpine:latest

RUN set -xe && \
apk add --no-cache --purge -uU \
curl git cgit py3-pygments python3 py3-markdown markdown \
fcgiwrap spawn-fcgi nginx gettext dumb-init && \
rm -rf /var/cache/apk/* /tmp/* && \
mkdir -p /srv/git

ENV ROOT_TITLE="Git" ROOT_DESC="My git repositories" SECTION_FROM_STARTPATH=0 MAX_REPO_COUNT=50 NOPLAINEMAIL=1
COPY --chown=nginx cgit.png /usr/share/webapps/cgit/
COPY --chown=nginx favicon.ico /usr/share/webapps/cgit/
COPY cgitrc.template /etc/
COPY nginx.conf /etc/nginx/
COPY start.sh /start.sh

VOLUME /var/lib/git /var/cache/cgit
EXPOSE 80
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/start.sh"]
Loading

0 comments on commit c5e8e17

Please sign in to comment.