From 9965cf9dfc3c99b2788210098befe28e7a141e80 Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Mon, 27 Feb 2023 13:33:28 -0500 Subject: [PATCH] initial revision --- Dockerfile | 21 +++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ NOTICE | 5 +++++ README.md | 17 +++++++++++++++++ ctx/home/.bashrc | 7 +++++++ ctx/home/.inputrc | 1 + justfile | 12 ++++++++++++ 7 files changed, 84 insertions(+) create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 NOTICE create mode 100644 README.md create mode 100644 ctx/home/.bashrc create mode 100644 ctx/home/.inputrc create mode 100644 justfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f25b596 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM alpine:edge + +RUN apk -U --no-cache add \ + sudo \ + bash less \ + coreutils grep gawk perl + # jq + +RUN adduser -h /home/cli -s /bin/bash -D cli cli && \ + addgroup cli wheel && \ + echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/allow-wheel + +COPY home /home/cli + +RUN chown -R cli:cli /home/cli + +WORKDIR /home/cli + +USER cli + +CMD ["/bin/bash", "-i"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..961b7f6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Jason Swank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..b8d6815 --- /dev/null +++ b/NOTICE @@ -0,0 +1,5 @@ +THIRD PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +This software incorporates material from third parties. +--- diff --git a/README.md b/README.md new file mode 100644 index 0000000..17ac92e --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# alpine-cli + +A minimal image for running Linux CLI utilities - shell scripts and similar. +This is useful for both interactive purposes or as the basis for other utility +images. + +## Quickstart + +```console +$ docker run -ti --rm ghcr.io/jswank/alpine-cli +~ $ ^D +exit + +$ just +~ $ ^D +exit +``` diff --git a/ctx/home/.bashrc b/ctx/home/.bashrc new file mode 100644 index 0000000..e046e4e --- /dev/null +++ b/ctx/home/.bashrc @@ -0,0 +1,7 @@ +export LANG=en_US.UTF-8 +export EDITOR=vi +export VISUAL=${EDITOR} +export PAGER=less +export LESS=RX # R for ANSI color sequences, X to not clear screen on exit +export TMPDIR=/var/tmp +export PS1="\w $ " diff --git a/ctx/home/.inputrc b/ctx/home/.inputrc new file mode 100644 index 0000000..b2cc9d6 --- /dev/null +++ b/ctx/home/.inputrc @@ -0,0 +1 @@ +set editing-mode vi diff --git a/justfile b/justfile new file mode 100644 index 0000000..6010f80 --- /dev/null +++ b/justfile @@ -0,0 +1,12 @@ +image := "ghcr.io/jswank/alpine-cli:latest" + +# get a bash shell on a temporary container using {{image}} +all: run + +# get a bash shell on a temporary container using {{image}} +run: + @ docker run -ti --rm {{image}} + +# build a new image +build: + docker build -t {{image}} -f Dockerfile ./ctx