1 | #!/usr/bin/env bash
|
2 | #
|
3 | # podman on Debian 12, instead of Docker
|
4 | #
|
5 | # Usage:
|
6 | # deps/podman.sh <function name>
|
7 |
|
8 |
|
9 | write-config() {
|
10 | mkdir -p ~/.config/containers
|
11 | cat > ~/.config/containers/registries.conf <<'EOF'
|
12 | unqualified-search-registries = ['docker.io']
|
13 | EOF
|
14 | }
|
15 |
|
16 | export-podman() {
|
17 | export DOCKER=podman
|
18 |
|
19 | # https://docs.podman.io/en/latest/markdown/podman.1.html
|
20 | export CONTAINERS_REGISTRIES_CONF=~/.config/containers/registries.conf
|
21 |
|
22 | # For some reason it uses /run/user/1000/containers by default
|
23 | export REGISTRY_AUTH_FILE=~/.config/containers/auth.json
|
24 | }
|
25 |
|
26 | login() {
|
27 | export-podman
|
28 |
|
29 | # type password on stdin
|
30 | sudo -E podman login -u oilshell --password-stdin
|
31 | }
|
32 |
|
33 | if test $(basename $0) = 'podman.sh'; then
|
34 | "$@"
|
35 | fi
|