From f9f566d6468786027d176cb22154bdf76eea485c Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Mon, 10 Jun 2024 12:32:39 +0200 Subject: [PATCH] Slim down image to 15 MB Base the image off Alpine to get another nice size saving: REPOSITORY TAG IMAGE ID CREATED SIZE localhost/inotify alpine 0346632c3067 4 hours ago 15 MB localhost/inotify debian 2d99b1b27626 4 hours ago 94 MB Functionality remains the same. --- Dockerfile | 9 ++------- monitor.sh | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a6523e..aaf8bf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,10 @@ -FROM debian:12-slim +FROM alpine:3.20 # Add inotify-tools for inotifywait # # We also install curl as scripts using this image often # call HTTP webhooks. -RUN apt-get -y update && apt-get install -y \ - curl \ - inotify-tools \ - jq \ - && apt autoclean \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache curl inotify-tools jq # Set our working directory WORKDIR /app diff --git a/monitor.sh b/monitor.sh index c40055c..e853f64 100755 --- a/monitor.sh +++ b/monitor.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -exo pipefail