File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 11# Fetch or build all required binaries
2- FROM golang:1.21-bookworm as builder
2+
3+ FROM public.ecr.aws/lambda/provided:al2 as builder
4+
5+ ADD https://go.dev/dl/go1.21.5.linux-amd64.tar.gz /tmp/go1.21.5.linux-amd64.tar.gz
36
47ARG VERSION_REF
58RUN test -n "${VERSION_REF}"
69
710ENV SRC github.com/segmentio/kubeapply
11+ ENV PATH=/usr/local/go/bin:/root/go/bin:/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
812
9- RUN apt-get update && apt-get install --no-install-recommends --yes \
13+ RUN yum install -y \
1014 curl \
15+ git \
16+ gzip \
17+ make \
18+ tar \
1119 unzip \
20+ which \
1221 wget
1322
1423COPY . /go/src/${SRC}
15- RUN cd /usr/local/bin && /go/src/${SRC}/scripts/pull-deps.sh
24+
25+ RUN cd /usr/local \
26+ && tar xf /tmp/go1.21.5.linux-amd64.tar.gz \
27+ && cd /usr/local/bin \
28+ && go env \
29+ && /go/src/${SRC}/scripts/pull-deps.sh
1630
1731WORKDIR /go/src/${SRC}
1832
@@ -24,7 +38,7 @@ RUN make kubeapply-lambda VERSION_REF=${VERSION_REF} && \
2438# Copy into final image from builder
2539FROM public.ecr.aws/lambda/provided:al2
2640
27- RUN yum install -y git unzip
41+ RUN yum install -y git unzip && yum clean all
2842
2943# Not sure if awscli is needed for running lambda, but keeping it here for now
3044RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip \
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ifndef VERSION_REF
22 VERSION_REF ?= $(shell git describe --tags --always --dirty="-dev")
33endif
44
5- LDFLAGS := -ldflags='-linkmode "external" -extldflags "-static" - s -w -X "main.VersionRef=$(VERSION_REF ) "'
5+ LDFLAGS := -ldflags='-s -w -X "main.VersionRef=$(VERSION_REF ) "'
66export GOFLAGS := -trimpath
77
88GOFILES = $(shell find . -iname '* .go' | grep -v -e vendor -e _modules -e _cache -e /data/)
You can’t perform that action at this time.
0 commit comments