OILS / deps / podman.sh View on Github | oils.pub

49 lines, 21 significant
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
9write-config() {
10 mkdir -p ~/.config/containers
11 cat > ~/.config/containers/registries.conf <<'EOF'
12unqualified-search-registries = ['docker.io']
13EOF
14}
15
16export-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
26login() {
27 export-podman
28
29 # type password on stdin
30 sudo -E podman login -u oilshell --password-stdin
31}
32
33test-image-stats() {
34 # Hm on Github Actions, images-layers.tsv comes up empty?
35 # The text file works though
36 # It works on sourcehut with the cpp-tarball task
37
38 which podman
39 podman --version
40 echo
41
42 soil/host-shim.sh save-image-stats '' podman '' ''
43
44 #soil/host-shim.sh image-layers-tsv podman '' ''
45}
46
47if test $(basename $0) = 'podman.sh'; then
48 "$@"
49fi