Skip to content

Instantly share code, notes, and snippets.

@jps3
Last active November 19, 2021 16:20
Show Gist options
  • Save jps3/c058d430ccb1b2937e0f33fc66093f2b to your computer and use it in GitHub Desktop.
Save jps3/c058d430ccb1b2937e0f33fc66093f2b to your computer and use it in GitHub Desktop.
Build lnav in alpine container to get latest version. (Had been frustrated with old version in typical Linux repos.)
syntax=docker/dockerfile:1
#
# Builds `lnav` in alpine container
# https://github.com/tstack/lnav
#
# docker build -t lnav:latest .
# docker run -it --rm -v "$PWD":"/data" lnav:latest /data/some.log
#
FROM alpine:latest AS builder
WORKDIR /lnav-build
RUN apk update && apk upgrade --no-cache
RUN apk add --no-cache \
automake autoconf build-base zlib-dev \
ncurses-dev pcre-dev readline-dev \
sqlite-dev openssh-keygen git
RUN git clone https://github.com/tstack/lnav.git /lnav-build
RUN ./autogen.sh
RUN ./configure --enable-static
RUN make -j 4
FROM alpine:latest
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache readline sqlite-libs ncurses
COPY --from=builder /lnav-build/src/lnav /usr/bin/
ENTRYPOINT ["/usr/bin/lnav"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment