Quellcode durchsuchen

Update Dockerfile

Teddysun vor 5 Jahren
Ursprung
Commit
cfc5340e1e
2 geänderte Dateien mit 17 neuen und 45 gelöschten Zeilen
  1. 9 23
      docker/kms/Dockerfile
  2. 8 22
      docker/kms/Dockerfile.architecture

+ 9 - 23
docker/kms/Dockerfile

@@ -1,32 +1,18 @@
 # Dockerfile for KMS Server
-# Copyright (C) 2018 - 2019 Teddysun <[email protected]>
+# Copyright (C) 2018 - 2020 Teddysun <[email protected]>
 # 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 <[email protected]>"
 
-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" ]

+ 8 - 22
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 <[email protected]>"
 
-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" ]