File tree Expand file tree Collapse file tree 5 files changed +55
-6
lines changed Expand file tree Collapse file tree 5 files changed +55
-6
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,24 @@ jobs:
5353 pip3 install awscli==1.16.292
5454 $(aws ecr get-login --no-include-email --region ${AWS_REGION} --registry-ids ${AWS_ACCOUNT_ID})
5555 - run :
56- name : Build and push image
56+ name : Build and push main image
5757 command : |
5858 export SHORT_GIT_SHA=$(echo ${CIRCLE_SHA1} | cut -c -7)
5959 docker build \
6060 -t ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply:${SHORT_GIT_SHA} \
6161 --build-arg VERSION_REF=${SHORT_GIT_SHA} \
6262 .
6363 docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply:${SHORT_GIT_SHA}
64+ - run :
65+ name : Build and push lambda image
66+ command : |
67+ export SHORT_GIT_SHA=$(echo ${CIRCLE_SHA1} | cut -c -7)
68+ docker build \
69+ -f Dockerfile.lambda \
70+ -t ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply-lambda:${SHORT_GIT_SHA} \
71+ --build-arg VERSION_REF=${SHORT_GIT_SHA} \
72+ .
73+ docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/kubeapply-lambda:${SHORT_GIT_SHA}
6474
6575workflows :
6676 version : 2
Original file line number Diff line number Diff line change 11Dockerfile
2+ Dockerfile.lambda
23build
34deps
45* zip
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ ENV SRC github.com/segmentio/kubeapply
88
99RUN apt-get update && apt-get install --yes \
1010 curl \
11- libbtrfs-dev \
12- libdevmapper-dev \
1311 wget
1412
1513COPY . /go/src/${SRC}
@@ -29,7 +27,6 @@ FROM ubuntu:18.04
2927RUN apt-get update && apt-get install --yes \
3028 curl \
3129 git \
32- libdevmapper-dev \
3330 python3 \
3431 python3-pip
3532
Original file line number Diff line number Diff line change 1+ # Fetch or build all required binaries
2+ FROM golang:1.14 as builder
3+
4+ ARG VERSION_REF
5+ RUN test -n "${VERSION_REF}"
6+
7+ ENV SRC github.com/segmentio/kubeapply
8+
9+ RUN apt-get update && apt-get install --yes \
10+ curl \
11+ wget
12+
13+ COPY . /go/src/${SRC}
14+ RUN cd /usr/local/bin && /go/src/${SRC}/scripts/pull-deps.sh
15+
16+ WORKDIR /go/src/${SRC}
17+
18+ ENV CGO_ENABLED=1
19+ ENV GO111MODULE=on
20+
21+ RUN make kubeapply VERSION_REF=${VERSION_REF} && \
22+ cp build/kubeapply /usr/local/bin
23+ RUN make kubeapply-lambda VERSION_REF=${VERSION_REF} && \
24+ cp build/kubeapply-lambda /usr/local/bin
25+
26+ # Copy into final image
27+ FROM public.ecr.aws/lambda/go:1
28+
29+ RUN yum install -y git
30+
31+ RUN curl -O https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
32+ RUN pip3 install awscli
33+
34+ COPY --from=builder /usr/local/bin/aws-iam-authenticator /usr/local/bin
35+ COPY --from=builder /usr/local/bin/helm /usr/local/bin
36+ COPY --from=builder /usr/local/bin/kubeval /usr/local/bin
37+ COPY --from=builder /usr/local/bin/kubectl /usr/local/bin
38+ COPY --from=builder /usr/local/bin/kubeapply /usr/local/bin
39+ COPY --from=builder /usr/local/bin/kubeapply-lambda /usr/local/bin
40+
41+ CMD [ "/usr/local/bin/kubeapply-lambda" ]
You can’t perform that action at this time.
0 commit comments