Use license-check docker image instead of curl

Optimizes Docker builds by copying from license-check Docker image
instead of using curl to download the tool.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
This commit is contained in:
hasheddan 2020-02-04 09:29:36 -06:00 committed by Alex Ellis
parent 0fc5eeefb9
commit 5fa7e0f8a0
5 changed files with 15 additions and 13 deletions

View File

@ -1,11 +1,12 @@
FROM teamserverless/license-check:0.3.6 as license-check
FROM golang:1.12-alpine3.11 as build
ENV GO111MODULE=off
ENV CGO_ENABLED=0
RUN apk add --no-cache curl ca-certificates
RUN curl -sLSf https://raw.githubusercontent.com/teamserverless/license-check/master/get.sh | sh \
&& mv ./license-check /usr/bin/
COPY --from=license-check /license-check /usr/bin/
WORKDIR /go/src/handler
COPY . .

View File

@ -1,11 +1,12 @@
FROM teamserverless/license-check:0.3.6 as license-check
FROM golang:1.12-alpine3.11 as build
ENV GO111MODULE=off
ENV CGO_ENABLED=0
RUN apk add --no-cache curl ca-certificates gcc musl-dev
RUN curl -sLSf https://raw.githubusercontent.com/teamserverless/license-check/master/get.sh | sh \
&& mv ./license-check /usr/bin/
COPY --from=license-check /license-check /usr/bin/
WORKDIR /go/src/handler
COPY . .

View File

@ -1,3 +1,5 @@
FROM teamserverless/license-check:0.3.6 as license-check
FROM golang:1.12 as build
ENV GO111MODULE=off
@ -10,9 +12,7 @@ ARG ARCH="x86_64"
ARG GOOS=linux
ARG GOARM
RUN curl -sLSf \
https://raw.githubusercontent.com/teamserverless/license-check/master/get.sh | sh \
&& mv ./license-check /usr/bin/
COPY --from=license-check /license-check /usr/bin/
WORKDIR /go/src/github.com/openfaas/faas/gateway

View File

@ -1,3 +1,5 @@
FROM teamserverless/license-check:0.3.6 as license-check
FROM golang:1.12 as build
ENV GO111MODULE=off
@ -7,9 +9,7 @@ ARG GIT_COMMIT_SHA
ARG GIT_COMMIT_MESSAGE
ARG VERSION='dev'
RUN curl -sLSf \
https://raw.githubusercontent.com/teamserverless/license-check/master/get.sh | sh \
&& mv ./license-check /usr/bin/
COPY --from=license-check /license-check /usr/bin/
WORKDIR /go/src/github.com/openfaas/faas/gateway

View File

@ -1,3 +1,5 @@
FROM teamserverless/license-check:0.3.6 as license-check
FROM golang:1.12 as build
ENV GO111MODULE=off
@ -7,9 +9,7 @@ ARG GIT_COMMIT_SHA
ARG GIT_COMMIT_MESSAGE
ARG VERSION='dev'
RUN curl -sLSf \
https://raw.githubusercontent.com/teamserverless/license-check/master/get.sh | sh \
&& mv ./license-check /usr/bin/
COPY --from=license-check /license-check /usr/bin/
WORKDIR /go/src/github.com/openfaas/faas/gateway