forked from coreos/coreos-assembler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd-podman-build
More file actions
executable file
·46 lines (40 loc) · 1.26 KB
/
cmd-podman-build
File metadata and controls
executable file
·46 lines (40 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -xeuo pipefail
meta=builds/latest/$(arch)/meta.json
name=$(jq -r .name "${meta}")
version=$(jq -r '."ostree-version"' "${meta}")
# can't use `rpm-ostree --print-json | jq .` here because the manifest may have
# variables that need to be set
ocp_version=$(python3 < src/config/packages-openshift.yaml -c '
import yaml, sys
y = yaml.safe_load(sys.stdin)
print(y["metadata"]["ocp_version"])')
node_tag=localhost/${name}-${ocp_version}-${version}-node
extensions_tag=localhost/${name}-${ocp_version}-${version}-extensions
target=${1:-}
case "${target}" in
node)
from=oci-archive:builds/latest/$(arch)/$(jq .images.ostree.path "$meta")
containerfile="src/config/Containerfile"
tag=${node_tag}
;;
extensions)
from=${node_tag}
containerfile="src/config/extensions/Dockerfile"
tag=${extensions_tag}
;;
"") echo "Usage: $0 (node|extensions) [extra podman args...]" >&2; exit 1;;
esac
shift
cat src/config/*.repo > tmp/all.repo
if [ -d src/yumrepos ]; then
cat src/yumrepos/*.repo >> tmp/all.repo
fi
repos=$(realpath tmp/all.repo)
set -x
podman build --from "$from" \
-t "${tag}" \
-f "${containerfile}" \
--secret id=yumrepos,src="$repos" \
-v /etc/pki/ca-trust:/etc/pki/ca-trust:ro \
--security-opt label=disable src/config "$@"