Skip to content
Permalink
Browse files

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>
  • Loading branch information
hasheddan authored and alexellis committed Feb 4, 2020
1 parent 0fc5eee commit 5fa7e0f8a0e842cb0c90bc529227617a5eb71bc9
Showing with 15 additions and 13 deletions.
  1. +3 −2 auth/basic-auth/Dockerfile
  2. +3 −2 auth/basic-auth/Dockerfile.arm64
  3. +3 −3 gateway/Dockerfile
  4. +3 −3 gateway/Dockerfile.arm64
  5. +3 −3 gateway/Dockerfile.armhf
@@ -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 . .
@@ -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 . .
@@ -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

@@ -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

@@ -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

0 comments on commit 5fa7e0f

Please sign in to comment.
You can’t perform that action at this time.