8 Commits

Author SHA1 Message Date
ElevenNotes
58910eb75d update readme 2025-02-12 22:46:00 +01:00
ElevenNotes
06e8f2a63e typos everywhere ... 2025-02-12 22:13:27 +01:00
ElevenNotes
6ec2821901 try parallel build for normal and unraid image including GUI 2025-02-12 22:00:47 +01:00
ElevenNotes
a3a755b54e switch to the-actions-org/workflow-dispatch to chain builds 2025-02-12 21:35:53 +01:00
ElevenNotes
dd0025df2d wrong suffix 2025-02-12 11:57:46 +01:00
ElevenNotes
23231c4cbb needs: docker 2025-02-12 11:52:02 +01:00
ElevenNotes
28586cccec add unraid version 2025-02-12 11:44:28 +01:00
ElevenNotes
ce51cbe448 missing image link 2025-02-12 08:35:33 +01:00
7 changed files with 105 additions and 62 deletions

View File

@@ -1,4 +1,4 @@
name: create and publish docker image
name: docker
on:
workflow_dispatch:
@@ -7,31 +7,29 @@ on:
description: 'set WORKFLOW_GITHUB_RELEASE'
required: false
default: 'false'
image:
description: 'set IMAGE'
required: false
uid:
description: 'set IMAGE_UID'
required: false
gid:
description: 'set IMAGE_GID'
required: false
semverprefix:
description: 'prefix for semver tags'
required: false
semversuffix:
description: 'suffix for semver tags'
required: false
dispatch:
description: 'run dispatch at end'
required: false
default: 'false'
push:
tags:
- 'v*'
jobs:
build-and-push-image:
docker:
runs-on: ubuntu-22.04
permissions:
contents: write
@@ -66,7 +64,6 @@ jobs:
echo "IMAGE_ARCH=${json_arch:-linux/amd64,linux/arm64}" >> $GITHUB_ENV
echo "WORKFLOW_GRYPE_SEVERITY_CUTOFF=${json_grype_severity:-high}" >> $GITHUB_ENV;
echo "WORKFLOW_GITHUB_RELEASE=${input_release:-true}" >> $GITHUB_ENV;
echo "WORKFLOW_DISPATCH=${input_dispatch:-true}" >> $GITHUB_ENV;
: # create tags for semver, stable and other shenanigans
LOCAL_SHA=$(git rev-parse --short HEAD)
@@ -81,15 +78,20 @@ jobs:
if [ ! -z ${LOCAL_SEMVER_MAJOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}${LOCAL_SEMVER_SUFFIX}"; fi
if [ ! -z ${LOCAL_SEMVER_MINOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}${LOCAL_SEMVER_SUFFIX}"; fi
if [ ! -z ${LOCAL_SEMVER_PATCH} ]; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}.${LOCAL_SEMVER_PATCH}${LOCAL_SEMVER_SUFFIX}"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_semver_stable}" ; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:stable"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_semver_latest}" ; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:latest"; fi
if [ ! -z ${json_semver_tags} ]; then SPECIAL_LOCAL_TAGS=$(echo ${json_semver_tags} | sed 's/,/ /g'); for LOCAL_TAG in ${json_semver_tags}; do LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_TAG}"; done; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_semver_stable}" ; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}stable${LOCAL_SEMVER_SUFFIX}"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_semver_latest}" ; then LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}latest${LOCAL_SEMVER_SUFFIX}"; fi
if [ ! -z ${json_semver_tags} ]; then SPECIAL_LOCAL_TAGS=$(echo ${json_semver_tags} | sed 's/,/ /g'); for LOCAL_TAG in ${json_semver_tags}; do LOCAL_TAGS="${LOCAL_TAGS},${LOCAL_IMAGE}:${LOCAL_SEMVER_PREFIX}${LOCAL_TAG}${LOCAL_SEMVER_SUFFIX}"; done; fi
echo "IMAGE_TAGS=${LOCAL_TAGS}" >> $GITHUB_ENV
: # if for whatever reason UID/GID must be changed at build time
if [ ! -z ${input_uid} ]; then echo "IMAGE_UID=${input_uid}" >> $GITHUB_ENV; else echo "IMAGE_UID=${json_uid:-1000}" >> $GITHUB_ENV; fi
if [ ! -z ${input_gid} ]; then echo "IMAGE_GID=${input_gid}" >> $GITHUB_ENV; else echo "IMAGE_GID=${json_gid:-1000}" >> $GITHUB_ENV; fi
: # set prefix or suffix globally
echo "IMAGE_SEMVER_PREFIX=${LOCAL_SEMVER_PREFIX}" >> $GITHUB_ENV
echo "IMAGE_SEMVER_SUFFIX=${LOCAL_SEMVER_SUFFIX}" >> $GITHUB_ENV
- name: docker / login to hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
@@ -109,8 +111,8 @@ jobs:
file: arch.dockerfile
push: true
platforms: ${{ env.IMAGE_ARCH }}
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max,compression=zstd,force-compression=true
cache-from: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }}
cache-to: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }},mode=max,compression=zstd,force-compression=true
build-args: |
APP_IMAGE=${{ env.IMAGE }}
APP_NAME=${{ env.json_name }}
@@ -118,32 +120,28 @@ jobs:
APP_ROOT=${{ env.json_root }}
APP_UID=${{ env.IMAGE_UID }}
APP_GID=${{ env.IMAGE_GID }}
NO_CACHE=$(date +%s)
APP_VERSION_PREFIX=${{ env.IMAGE_SEMVER_PREFIX }}
APP_VERSION_SUFFIX=${{ env.IMAGE_SEMVER_SUFFIX }}
APP_NO_CACHE=$(date +%s)
tags: |
${{ env.IMAGE }}:grype
${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}
- name: grype / scan
id: scan
uses: anchore/scan-action@abae793926ec39a78ab18002bc7fc45bbbd94342
with:
image: ${{ env.IMAGE }}:grype
image: ${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}
severity-cutoff: ${{ env.WORKFLOW_GRYPE_SEVERITY_CUTOFF }}
- name: grype / report / print
if: success() || failure()
run: cat ${{ steps.scan.outputs.sarif }}
- name: grype / report / annotation
if: success() || failure()
uses: Miragon/sarif-report-parse@f8bcc5ece9c2b9a786ff4e7392cca2bb72ae8b4b
with:
sarif-file: ${{ steps.scan.outputs.sarif }}
- name: grype / delete tag
if: success() || failure()
run: |
curl --request DELETE \
--url https://hub.docker.com/v2/repositories/${{ env.IMAGE }}/tags/grype/ \
--url https://hub.docker.com/v2/repositories/${{ env.IMAGE }}/tags/${{ env.IMAGE_SEMVER_PREFIX }}grype${{ env.IMAGE_SEMVER_SUFFIX }}/ \
--header 'authorization: jwt ${{ secrets.DOCKER_TOKEN }}' \
--header 'content-type: application/json' \
--fail
@@ -162,8 +160,8 @@ jobs:
sbom: true
provenance: mode=max
platforms: ${{ env.IMAGE_ARCH }}
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max,compression=zstd,force-compression=true
cache-from: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }}
cache-to: type=registry,ref=${{ env.IMAGE }}:${{ env.IMAGE_SEMVER_PREFIX }}buildcache${{ env.IMAGE_SEMVER_SUFFIX }},mode=max,compression=zstd,force-compression=true
build-args: |
APP_IMAGE=${{ env.IMAGE }}
APP_NAME=${{ env.json_name }}
@@ -171,7 +169,9 @@ jobs:
APP_ROOT=${{ env.json_root }}
APP_UID=${{ env.IMAGE_UID }}
APP_GID=${{ env.IMAGE_GID }}
NO_CACHE=$(date +%s)
APP_VERSION_PREFIX=${{ env.IMAGE_SEMVER_PREFIX }}
APP_VERSION_SUFFIX=${{ env.IMAGE_SEMVER_SUFFIX }}
APP_NO_CACHE=$(date +%s)
tags: |
${{ env.IMAGE_TAGS }}
@@ -208,11 +208,4 @@ jobs:
destination_container_repo: ${{ env.IMAGE }}
provider: dockerhub
short_description: ${{ env.json_readme_description }}
readme_file: 'README.md'
- name: github / dispatch workflow
if: env.WORKFLOW_DISPATCH == 'true' && env.json_dispatch_workflow != null
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc
with:
workflow: ${{ env.json_dispatch_workflow }}
token: "${{ secrets.REPOSITORY_TOKEN }}"
readme_file: 'README.md'

View File

@@ -1,17 +0,0 @@
name: kms-gui
on:
workflow_dispatch:
jobs:
kms-gui:
runs-on: ubuntu-latest
steps:
- name: auto build and update downstream image
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc
with:
workflow: docker.yml
repo: 11notes/docker-kms-gui
ref: master
token: "${{ secrets.REPOSITORY_TOKEN }}"
inputs: '{ "release": "false" }'

51
.github/workflows/tags.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: tags
on:
push:
tags:
- 'v*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: build docker image
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7
with:
workflow: docker.yml
token: "${{ secrets.REPOSITORY_TOKEN }}"
inputs: '{ "release":"true" }'
docker-unraid:
runs-on: ubuntu-latest
steps:
- name: build docker image for unraid community
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7
with:
workflow: docker.yml
token: "${{ secrets.REPOSITORY_TOKEN }}"
inputs: '{ "release":"false", "uid":"99", "gid":"100", "semversuffix":"unraid" }'
kms-gui:
runs-on: ubuntu-latest
needs: docker
steps:
- name: build downstream kms gui
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7
with:
workflow: docker.yml
token: "${{ secrets.REPOSITORY_TOKEN }}"
repo: 11notes/docker-kms-gui
ref: master
inputs: '{ "release":"false" }'
kms-gui-unraid:
runs-on: ubuntu-latest
needs: docker-unraid
steps:
- name: build downstream kms gui for unraid community
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7
with:
workflow: docker.yml
token: "${{ secrets.REPOSITORY_TOKEN }}"
repo: 11notes/docker-kms-gui
ref: master
inputs: '{ "release":"false", "uid":"99", "gid":"100", "semversuffix":"unraid" }'

4
.json
View File

@@ -14,9 +14,5 @@
"parent":{
"image":"11notes/alpine:stable"
}
},
"dispatch":{
"workflow":"gui.yml"
}
}

View File

@@ -1,12 +1,22 @@
![Banner](https://github.com/11notes/defaults/blob/main/static/img/banner.png?raw=true)
# 🏔️ on Alpine
# 🏔️ kms on Alpine
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms)![size](https://img.shields.io/docker/image-size/11notes/kms/465f4d1?color=0eb305)![version](https://img.shields.io/docker/v/11notes/kms/465f4d1?color=eb7a09)![pulls](https://img.shields.io/docker/pulls/11notes/kms?color=2b75d6)[<img src="https://img.shields.io/github/issues/11notes/docker-kms?color=7842f5">](https://github.com/11notes/docker-kms/issues)
**Activate any version of Windows and Office, forever**
![activation](https://github.com/11notes/docker-/blob/master/img/activation.png?raw=true)
![GUI](https://github.com/11notes/docker-/blob/master/img/GUI.png?raw=true)
![activation](https://github.com/11notes/docker-kms/blob/master/img/activation.png?raw=true)
![GUI](https://github.com/11notes/docker-kms/blob/master/img/GUI.png?raw=true)
# MAIN TAGS 🏷️
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
* [465f4d1](https://hub.docker.com/r/11notes/kms/tags?name=465f4d1)
* [stable](https://hub.docker.com/r/11notes/kms/tags?name=stable)
* [latest](https://hub.docker.com/r/11notes/kms/tags?name=latest)
* [465f4d1-unraid](https://hub.docker.com/r/11notes/kms/tags?name=465f4d1-unraid)
* [stable-unraid](https://hub.docker.com/r/11notes/kms/tags?name=stable-unraid)
* [latest-unraid](https://hub.docker.com/r/11notes/kms/tags?name=latest-unraid)
# SYNOPSIS 📖
**What can I do with this?** This image will run a KMS server you can use to activate any version of Windows and Office, forever.
@@ -81,6 +91,9 @@ Activate server
slmgr /ato
```
# UNRAID VERSION 🟠
This image supports unraid by default. Simply add **-unraid** to any tag and the image will run as 99:100 instead of 1000:1000 causing no issues on unraid. Enjoy.
# DEFAULT SETTINGS 🗃️
| Parameter | Value | Description |
| --- | --- | --- |

View File

@@ -1,2 +1,2 @@
### 📣 Breaking
* Removed KMS_IP and KMS_PORT since this is done by the container networking anyway
### 🪄 Features
* add unraid version to base kms image (GUI will follow)

View File

@@ -20,6 +20,8 @@
ARG APP_NAME
ARG APP_VERSION
ARG APP_ROOT
ARG APP_UID
ARG APP_GID
# :: environment
ENV APP_IMAGE=${APP_IMAGE}
@@ -39,6 +41,7 @@
# :: Run
USER root
RUN eleven printenv;
# :: install application
RUN set -ex; \
@@ -61,6 +64,10 @@
${APP_ROOT} \
/opt/py-kms;
# :: support unraid
RUN set -ex; \
eleven unraid
# :: Volumes
VOLUME ["${APP_ROOT}/var"]