initial revision

This commit is contained in:
Jason Swank 2023-02-27 13:33:28 -05:00
commit 9965cf9dfc
7 changed files with 84 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -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"]

21
LICENSE Normal file
View File

@ -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.

5
NOTICE Normal file
View File

@ -0,0 +1,5 @@
THIRD PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize
This software incorporates material from third parties.
---

17
README.md Normal file
View File

@ -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
```

7
ctx/home/.bashrc Normal file
View File

@ -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 $ "

1
ctx/home/.inputrc Normal file
View File

@ -0,0 +1 @@
set editing-mode vi

12
justfile Normal file
View File

@ -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