/image-sitter

collection of bash scripts to maintain docker images.

Primary LanguageShellMIT LicenseMIT

Image Sitter

Programs to take care of your container images. It helps to ensure you have an up to date local cache of the docker images that are frequently used.

Introduction

By maintaining the docker url in several files, categorize into groups, and 3 predefined subgroups, which are 'pull-always', 'pull-if-not-exists', and 'delete-if-exists'. image-sitter programs will do the necessary pull or delete when they are triggered.

Format of files

  • Each line of a file is a docker url, such as: nginx:latest.
  • lines started with # will be ignored.
  • blank lines will also be ignored.

Commands

image-sitter-init group
image-sitter group [group ...]
image-sitter-pull-always group [group ...]
image-sitter-pull-if-not-exists group [group ...]
image-sitter-delete-if-exists group [group ...]

Sample

sample

Quick Start

Installation

$ sudo curl -L https://siakhooi.github.io/apt/siakhooi-apt.list | sudo tee /etc/apt/sources.list.d/siakhooi-apt.list > /dev/null
$ sudo curl -L https://siakhooi.github.io/apt/siakhooi-apt.gpg  | sudo tee /usr/share/keyrings/siakhooi-apt.gpg > /dev/null
$ sudo apt update
$ sudo apt install siakhooi-image-sitter
  • To setup bash completion, add the following code in ~/.bashrc file.
source <(image-sitter-completion)

Using Image Sitter

# create the group
image-sitter-init quick-start-1

# pull images
image-sitter quick-start-1

Directory structure

~/.image-sitter/
   + group1/
      + pull-always/
         + file1.txt
         + file2.txt
         + ...
      + pull-if-not-exists/
         + file1.txt
         + file2.txt
         + ...
      + delete-if-exists/
         + file1.txt
         + file2.txt
         + ...
   + group2/
      + pull-always/
         + file1.txt
         + file2.txt
         + ...
      + pull-if-not-exists/
         + file1.txt
         + file2.txt
         + ...
      + delete-if-exists/
         + file1.txt
         + file2.txt
         + ...
   + ...

Deployments

Badges

GitHub GitHub last commit GitHub tag (latest by date) GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub top language GitHub language count Lines of code GitHub repo size GitHub code size in bytes Workflow workflow workflow Release GitHub release (latest by date) GitHub all releases GitHub Release Date

Generic badge Generic badge visitors