View image in linux ascii terminal

  • Install / Download binary from https://github.com/atanunq/viu

Dockerfile

FROM rust:slim-buster as build
ARG ARCH
WORKDIR opt
RUN rustup target add $ARCH-unknown-linux-musl
RUN apt update && apt install git -y
RUN git clone https://github.com/atanunq/viu
WORKDIR viu
RUN cargo build --target $ARCH-unknown-linux-musl --release
RUN cp /viu/target/$ARCH-unknown-linux-musl/release/viu /usr/bin

FROM alpine:3.15.0
COPY --from=build /opt/viu/target/$ARCH-unknown-linux-musl/release/viu /usr/bin
ENTRYPOINT ["viu"]
  • docker build with args
podman build -t viu --build-arg ARCH=x86_64 .
docker run -it -v $(pwd):/opt viu "/opt/img/bfa.jpg"
  • https://doc.rust-lang.org/nightly/rustc/platform-support.html
  • https://unix.stackexchange.com/questions/35333/what-is-the-fastest-way-to-view-images-from-the-terminal