alpine-cli/README.md
2023-03-28 20:01:14 -04:00

62 lines
1.3 KiB
Markdown

# 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
$ bin/cli
~ $ ^D
exit
```
## More Info
The image is based on *alpine:edge*, with a small amount of additional setup/installation done. See
the [Dockerfile](Dockerfile) and [ctx/](ctx) for the specifics.
- Some basic utilities are installed for interative and script-based shell usage
- A user is created with sudo (`-u root`) access.
- A few personal preferences are enabled via dotfiles.
A helper script, using [casey/just](https://github.com/casey/just') is in [bin/cli](bin/cli).
It can be used to quickly start an ephemeral (or persistent) container.
```console
$ bin/cli --list
Available recipes:
clean # remove the persistent image
default # run
persist # run (or attach to) a perisent container {{n}}
run # run a temporary container based on {{image}}
$ bin/cli
~ $ ^D
exit
$ bin/cli persist
~ $ ls
~ $
exit
$ podman cp foo.json cli:/home/cli
$ bin/cli persist
~ $ ls
foo.json
~ $ ^D
exit
```
Bonus - the same script could be used to start other containers:
```console
$ bin/cli image=alpine:edge
/ # ^D
```