From 2e80ea379edd2611106e6ce4c6325298f4c80c61 Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 19 Jul 2024 13:21:02 -0500 Subject: [PATCH] chore: Update ncdu Dockerfile to use Alpine instead of Debian and optimize package installation --- ncdu/Dockerfile | 33 +++++++++++++++++++-------------- ncdu/VERSION | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ncdu/Dockerfile b/ncdu/Dockerfile index f41138d..1a8d3bf 100644 --- a/ncdu/Dockerfile +++ b/ncdu/Dockerfile @@ -1,23 +1,28 @@ -FROM debian:latest +FROM golang:alpine as builder -# Install required packages -RUN apt-get update && apt-get install -y \ +# Install necessary packages +RUN apk add --no-cache \ + git \ + vim + +# Clone and build gotty +RUN git clone https://github.com/sorenisanerd/gotty.git /gotty && \ + cd /gotty && \ + go build + +FROM alpine:latest + +# Install ncdu, procps, curl, iproute2, and clean up +RUN apk add --no-cache \ ncdu \ procps \ curl \ iproute2 \ - git \ - golang-go \ vim \ - && apt-get clean - -# Clone, build, and install gotty -RUN git clone https://github.com/sorenisanerd/gotty.git /tmp/gotty && \ - cd /tmp/gotty && \ - go build && \ - mv gotty /usr/local/bin/ && \ - cd / && \ - rm -rf /tmp/gotty + && rm -rf /var/cache/apk/* + +# Copy the built gotty binary from the builder stage +COPY --from=builder /gotty/gotty /usr/local/bin/gotty # Set the terminal to support UTF-8 ENV LANG C.UTF-8 diff --git a/ncdu/VERSION b/ncdu/VERSION index 8acdd82..4e379d2 100644 --- a/ncdu/VERSION +++ b/ncdu/VERSION @@ -1 +1 @@ -0.0.1 +0.0.2