Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 3083b56

Browse files
author
Sameer Naik
committed
dockerfile: error out on curl errors
1 parent bee0b3c commit 3083b56

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

java8/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FROM openjdk:8-jre-alpine
33
COPY runtime /var/runtime
44

55
RUN apk update && apk add --no-cache libc6-compat curl \
6-
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > /var/runtime/mockserver \
6+
&& API_VERSION=$(curl -sSfI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sSfL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > /var/runtime/mockserver \
88
&& chmod +x /var/runtime/mockserver
99

1010
ENV LD_LIBRARY_PATH /lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib

node-10.x/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM node:10-alpine
22
WORKDIR /opt
33

44
RUN apk --no-cache add curl \
5-
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6-
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
5+
&& API_VERSION=$(curl -sSfI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sSfI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sSfL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
88
&& chmod +x aws-custom-runtime \
9-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/node-10.x \
9+
&& curl -sSfL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/node-10.x \
1010
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/node-10.x/* .
1111

1212
ENV LAMBDA_TASK_ROOT "/opt"

node-4.x/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM node:4-alpine
22
WORKDIR /opt
33

44
RUN apk --no-cache add curl \
5-
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6-
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
5+
&& API_VERSION=$(curl -sfSI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sfSI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sfSL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
88
&& chmod +x aws-custom-runtime \
9-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/node-4.x \
9+
&& curl -sfSL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/node-4.x \
1010
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/node-4.x/* .
1111

1212
ENV LAMBDA_TASK_ROOT "/opt"

python-2.7/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM python:2.7-alpine
22
WORKDIR /opt
33

44
RUN apk --no-cache add curl \
5-
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6-
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
5+
&& API_VERSION=$(curl -sSfI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sSfI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sSfL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
88
&& chmod +x aws-custom-runtime \
9-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/python-2.7 \
9+
&& curl -sSfL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/python-2.7 \
1010
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/python-2.7/* .
1111

1212
ENV LAMBDA_TASK_ROOT "/opt"

python-3.7/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ WORKDIR /opt
33

44
RUN apt-get update \
55
&& apt-get install -y curl \
6-
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7-
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
8-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
6+
&& API_VERSION=$(curl -sSfI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& RUNTIME_VERSION=$(curl -sSfI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
8+
&& curl -sSfL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
99
&& chmod +x aws-custom-runtime \
10-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/python-3.7 \
10+
&& curl -sSfL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/python-3.7 \
1111
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/python-3.7/* .
1212

1313
ENV LAMBDA_TASK_ROOT "/opt"

ruby-2.5/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FROM ruby:2.5-alpine
33
WORKDIR /opt
44

55
RUN apk --no-cache add curl \
6-
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
6+
&& API_VERSION=$(curl -sSfI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep -i "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sSfL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime-linux-amd64 > aws-custom-runtime \
88
&& chmod +x aws-custom-runtime
99

1010
ENV RUBYLIB "/opt"

0 commit comments

Comments
 (0)