From 7ab82c556b611ac67ead4cb709c5084c2e6ae4ef Mon Sep 17 00:00:00 2001 From: Peter Bomber Date: Mon, 13 Mar 2023 14:33:01 +1300 Subject: [PATCH] Add nsenter to linux Periscope image --- builder/Dockerfile.linux | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/builder/Dockerfile.linux b/builder/Dockerfile.linux index 0269673d..9459af43 100644 --- a/builder/Dockerfile.linux +++ b/builder/Dockerfile.linux @@ -18,9 +18,22 @@ COPY . . RUN go build ./cmd/aks-periscope +# Add dependencies for building nsenter +RUN apt-get update && \ + apt-get install -y autoconf autopoint bison gettext libtool + +# Create a statically-compiled nsenter binary (see: https://github.com/alexei-led/nsenter/blob/master/Dockerfile) +# nsenter versions: https://www.kernel.org/pub/linux/utils/util-linux/ +ADD https://github.com/util-linux/util-linux/archive/v2.38.tar.gz . +RUN tar -xf v2.38.tar.gz && mv util-linux-2.38 util-linux +WORKDIR /build/util-linux +RUN ./autogen.sh && ./configure +RUN make LDFLAGS="--static" nsenter + # Runner FROM $BASE_IMAGE COPY --from=builder /build/aks-periscope / +COPY --from=builder /build/util-linux/nsenter /usr/bin/ ENTRYPOINT ["/aks-periscope"]