mirror of
https://github.com/11notes/docker-kms.git
synced 2025-11-01 20:43:32 +00:00
first commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/maintain
|
||||
66
amd64.dockerfile
Normal file
66
amd64.dockerfile
Normal file
@@ -0,0 +1,66 @@
|
||||
# :: Build
|
||||
FROM alpine:latest as build
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --update --no-cache \
|
||||
curl \
|
||||
wget \
|
||||
unzip \
|
||||
build-base \
|
||||
linux-headers \
|
||||
make \
|
||||
cmake \
|
||||
g++ \
|
||||
git; \
|
||||
git clone https://github.com/SystemRage/py-kms.git /tmp/py-kms; \
|
||||
mv /tmp/py-kms/py-kms /usr/local/bin;
|
||||
|
||||
# :: Header
|
||||
FROM python:3.7.10-alpine
|
||||
COPY --from=build /usr/local/bin/ /usr/local/bin
|
||||
|
||||
# :: Run
|
||||
USER root
|
||||
|
||||
# :: prepare
|
||||
RUN set -ex; \
|
||||
mkdir -p /kms; \
|
||||
mkdir -p /kms/var; \
|
||||
ln -sf /dev/stdout /var/log/kms.log;
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --update --no-cache \
|
||||
py3-configargparse \
|
||||
py3-flask \
|
||||
py3-pygments \
|
||||
python3-tkinter \
|
||||
sqlite-libs \
|
||||
python3-dev \
|
||||
sqlite-dev \
|
||||
gcc \
|
||||
musl-dev \
|
||||
py3-pip; \
|
||||
pip3 install \
|
||||
peewee \
|
||||
tzlocal \
|
||||
pysqlite3;
|
||||
|
||||
RUN set -ex; \
|
||||
addgroup --gid 1000 -S kms; \
|
||||
adduser --uid 1000 -D -S -h /kms -s /sbin/nologin -G kms kms;
|
||||
|
||||
# :: copy root filesystem changes
|
||||
COPY ./rootfs /
|
||||
|
||||
# :: docker -u 1000:1000 (no root initiative)
|
||||
RUN set -ex; \
|
||||
chown -R kms:kms \
|
||||
/kms
|
||||
|
||||
# :: Volumes
|
||||
VOLUME ["/kms/var"]
|
||||
|
||||
# :: Start
|
||||
RUN set -ex; chmod +x /usr/local/bin/entrypoint.sh
|
||||
USER kms
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
20
rootfs/usr/local/bin/entrypoint.sh
Normal file
20
rootfs/usr/local/bin/entrypoint.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/ash
|
||||
|
||||
echo "$(date +'%Y-%m-%d %T') starting py-kms server ..."
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
set -- "python3" \
|
||||
/usr/local/bin/py-kms/pykms_Server.py \
|
||||
0.0.0.0 \
|
||||
1688 \
|
||||
-l 1033 \
|
||||
-c 26 \
|
||||
-a 120 \
|
||||
-r 10080 \
|
||||
-s /kms/var/kms.db \
|
||||
-w RANDOM \
|
||||
-V WARNING \
|
||||
-F /var/log/kms.log
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user