-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
- Loading branch information
Showing
7 changed files
with
904 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
name: main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ludeeus/[email protected] | ||
ci-mark: | ||
needs: | ||
- lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo mark | ||
build: | ||
needs: ci-mark | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: docker/[email protected] | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: ev | ||
run: | | ||
if [ -z "${{ github.event.pull_request.head.sha }}" ]; then | ||
echo "sha=${GITHUB_SHA}" > "${GITHUB_OUTPUT}" | ||
else | ||
echo "sha=${{ github.event.pull_request.head.sha }}" > "${GITHUB_OUTPUT}" | ||
fi | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: "${{ github.ref == 'refs/heads/main' }}" | ||
tags: | | ||
ghcr.io/authentik-community/krb5:${{ steps.ev.outputs.sha }} | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: | | ||
GIT_BUILD_HASH=${{ steps.ev.outputs.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/[email protected] | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: ev | ||
run: | | ||
echo "version=${GITHUB_REF#refs/tags/version/}" > "${GITHUB_OUTPUT}" | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/authentik-community/krb5:${{ steps.ev.outputs.version }} | ||
ghcr.io/authentik-community/krb5:latest | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: | | ||
GIT_BUILD_HASH=${{ steps.ev.outputs.sha }} | ||
VERSION=${{ steps.ev.outputs.version }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM debian:12 | ||
|
||
ARG GIT_BUILD_HASH | ||
ARG VERSION | ||
|
||
LABEL org.opencontainers.image.url https://github.com/authentik-community/krb5-docker | ||
LABEL org.opencontainers.image.description Run an MIT Kerberos 5 KDC in a container | ||
LABEL org.opencontainers.image.source https://github.com/authentik-community/krb5-docker.git | ||
LABEL org.opencontainers.image.version ${VERSION} | ||
LABEL org.opencontainers.image.revision ${GIT_BUILD_HASH} | ||
|
||
ENV KRB5_CONFIG=/etc/krb5.conf \ | ||
KRB5_KDC_PROFILE=/etc/krb5kdc/kdc.conf \ | ||
KRB5_DATA_DIR=/var/lib/krb5kdc | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends pwgen krb5-kdc krb5-admin-server krb5-kdc-ldap krb5-k5tls krb5-otp krb5-pkinit krb5-strength && \ | ||
apt-get clean && \ | ||
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/ && \ | ||
adduser --system --no-create-home --uid 1000 --group --home /var/lib/krb5kdc krb5kdc && \ | ||
mkdir -p /var/lib/krb5kdc && \ | ||
rm -rf /var/lib/krb5kdc/* && \ | ||
echo > /etc/krb5.conf && \ | ||
echo > /etc/krb5kdc/kdc.conf && \ | ||
chown -R krb5kdc:krb5kdc /var/lib/krb5kdc /etc/krb5.conf /etc/krb5kdc | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
|
||
USER 1000 | ||
|
||
WORKDIR /var/lib/krb5kdc | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] |
Oops, something went wrong.