py-kms is a port of node-kms created by cyrozap, which is a port of either the C#, C++, or .NET implementations of KMS Emulator. The original version was written by CODYQX4 and is derived from the reverse-engineered code of Microsoft's official KMS. This version of py-kms is itself a fork of the original implementation by SystemRage, which was abandoned early 2021.
These are my own builds of the Minimal image using the LSIO base and s6 because the upstream project keeps accepting PRs for the entrypoint scripts that change their behaviour in ways that break the container.
Our images support multiple architectures.
Simply pulling ghcr.io/thespad/py-kms:latest should retrieve the correct image for your arch.
The architectures supported by this image are:
| Architecture | Available | Tag |
|---|---|---|
| x86-64 | ✅ | latest |
| arm64 | ✅ | latest |
More info at py-kms.
This image can be run with a read-only container filesystem.
Running the container read-only requires mounting /run to tmpfs with the exec flag.
This image can be run with a non-root user.
Here are some example snippets to help you get started creating a container.
---
services:
py-kms:
image: ghcr.io/thespad/py-kms:latest
container_name: py-kms
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- IP=0.0.0.0 #optional
volumes:
- /path/to/py-kms/config:/config
ports:
- 1688:1688
restart: unless-stopped
docker run -d \
--name=py-kms \
-e PUID=1000 \
-e PGID=1000 \
-e IP=0.0.0.0 `#optional` \
-e TZ=Europe/London \
-p 1688:1688 \
-v /path/to/py-kms/config:/config \
--restart unless-stopped \
ghcr.io/thespad/py-kms:latest
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.
| Parameter | Function |
|---|---|
-p 1688 | KMS Port |
-e PUID=1000 | for UserID - see below for explanation |
-e PGID=1000 | for GroupID - see below for explanation |
-e TZ=Europe/London | Specify a timezone to use EG Europe/London |
-e IP= | IP address to bind to. Use 0.0.0.0 for all IPv4 interfaces, use :: for all IPv6 interfaces, or specify a full address. Note that for compose you must quote the full variable, e.g. - "IP=0.0.0.0" or - "IP=::". |
-v /config | Contains all relevant configuration files. |
When using volumes (-v flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
In this instance PUID=1000 and PGID=1000, to find yours use id user as below:
$ id username
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
docker exec -it py-kms /bin/bashdocker logs -f py-kmsMost of our images are static, versioned, and require an image update and container recreation to update the app inside. We do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.
Below are the instructions for updating containers:
docker-compose pull
docker-compose pull py-kmsdocker-compose up -d
docker-compose up -d py-kmsdocker image prunedocker pull ghcr.io/thespad/py-kmsdocker stop py-kmsdocker rm py-kms/config folder and settings will be preserved)docker image prune[!TIP] We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
If you want to make local modifications to these images for development purposes or just to customize the logic:
git clone https://github.com/thespad/docker-py-kms.git
cd docker-py-kms
docker build \
--no-cache \
--pull \
-t ghcr.io/thespad/py-kms:latest .
The arm variants can be built on x86_64 hardware and vice versa using lscr.io/linuxserver/qemu-static
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset
main.pytz.Content type
Image
Digest
sha256:659bdd942…
Size
34.6 MB
Last updated
4 days ago
docker pull thespad/py-kms