From 68f2b9d2ff6a7180e18c68d197827af133fd194b Mon Sep 17 00:00:00 2001 From: Aavesh Verma <10639490@INFPUMAC09.local> Date: Tue, 21 Sep 2021 23:07:12 +0530 Subject: [PATCH] Update the docker image of aws controller. --- admission-controller/Dockerfile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/admission-controller/Dockerfile b/admission-controller/Dockerfile index e5f8034..e3686a6 100644 --- a/admission-controller/Dockerfile +++ b/admission-controller/Dockerfile @@ -1,3 +1,17 @@ -FROM amazonlinux -COPY ./adm-controller /adm-controller -ENTRYPOINT ["/adm-controller"] +FROM amazonlinux AS build +RUN yum -y update && yum -y install tar gzip +RUN curl -o go1.14.3.linux-amd64.tar.gz https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz -s +RUN tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz +ENV PATH="/usr/local/go/bin:${PATH}" +WORKDIR /src/admission-controller +COPY ./go.mod ./go.sum ./ +RUN go mod download +COPY . ./ +RUN go build -o /app -v ./ + + +FROM amazonlinux:latest +RUN yum -y update && yum install -y ca-certificates && rm -rf /var/cache/yum/* +COPY --from=build /app /. +ENTRYPOINT ["/app"] +