From cfc5340e1eff24c9aff798bdc2b4dc4c8b3eed70 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Thu, 30 Jan 2020 20:47:18 +0900 Subject: [PATCH] Update Dockerfile --- docker/kms/Dockerfile | 32 +++++++++--------------------- docker/kms/Dockerfile.architecture | 30 ++++++++-------------------- 2 files changed, 17 insertions(+), 45 deletions(-) diff --git a/docker/kms/Dockerfile b/docker/kms/Dockerfile index e54e759..921caf3 100644 --- a/docker/kms/Dockerfile +++ b/docker/kms/Dockerfile @@ -1,32 +1,18 @@ # Dockerfile for KMS Server -# Copyright (C) 2018 - 2019 Teddysun +# Copyright (C) 2018 - 2020 Teddysun # Reference URL: # https://github.com/Wind4/vlmcsd +FROM alpine:latest AS builder +WORKDIR /root +RUN apk add --no-cache git make build-base && \ + git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \ + cd vlmcsd/ && \ + make + FROM alpine:latest LABEL maintainer="Teddysun " -ENV KMS_RELEASE https://github.com/Wind4/vlmcsd/archive/master.zip - -RUN runDeps="\ - g++ \ - gcc \ - wget \ - make \ - unzip \ - "; \ - set -ex \ - && apk add --no-cache --virtual .build-deps ${runDeps} \ - && cd /tmp \ - && wget -O vlmcsd.zip ${KMS_RELEASE} \ - && unzip vlmcsd.zip \ - && cd vlmcsd-master \ - && make \ - && cp -p bin/vlmcsd /usr/bin/ \ - && chmod 755 /usr/bin/vlmcsd \ - && rm -rf /tmp/vlmcsd.zip /tmp/vlmcsd-master \ - && apk del .build-deps - +COPY --from=builder /root/vlmcsd/bin/vlmcsd /usr/bin/vlmcsd EXPOSE 1688 - CMD [ "vlmcsd", "-D" ] diff --git a/docker/kms/Dockerfile.architecture b/docker/kms/Dockerfile.architecture index 84165b7..9ea5d47 100644 --- a/docker/kms/Dockerfile.architecture +++ b/docker/kms/Dockerfile.architecture @@ -3,30 +3,16 @@ # Reference URL: # https://github.com/Wind4/vlmcsd +FROM --platform=$TARGETPLATFORM alpine:latest AS builder +WORKDIR /root +RUN apk add --no-cache git make build-base && \ + git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \ + cd vlmcsd/ && \ + make + FROM --platform=$TARGETPLATFORM alpine:latest LABEL maintainer="Teddysun " -ENV KMS_RELEASE https://github.com/Wind4/vlmcsd/archive/master.zip - -RUN runDeps="\ - g++ \ - gcc \ - wget \ - make \ - unzip \ - "; \ - set -ex \ - && apk add --no-cache --virtual .build-deps ${runDeps} \ - && cd /tmp \ - && wget -O vlmcsd.zip ${KMS_RELEASE} \ - && unzip vlmcsd.zip \ - && cd vlmcsd-master \ - && make \ - && cp -p bin/vlmcsd /usr/bin/ \ - && chmod 755 /usr/bin/vlmcsd \ - && rm -rf /tmp/vlmcsd.zip /tmp/vlmcsd-master \ - && apk del .build-deps - +COPY --from=builder /root/vlmcsd/bin/vlmcsd /usr/bin/vlmcsd EXPOSE 1688 - CMD [ "vlmcsd", "-D" ]