File: run-container

package info (click to toggle)
fatrace 0.19.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 216 kB
  • sloc: ansic: 710; python: 528; sh: 36; makefile: 26
file content (28 lines) | stat: -rwxr-xr-x 666 bytes parent folder | download
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
#!/bin/sh
set -eu

IMAGE="${1:-registry.fedoraproject.org/fedora:latest}"

podman run --interactive --rm --privileged -v "$(pwd):/src" -w /src "$IMAGE" <<EOF
set -eux

# overlayfs does not support fanotify
mount -t tmpfs tmpfs /tmp

if type apt >/dev/null 2>&1; then
    apt-get update
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc libc-dev make python3 btrfs-progs
else
    dnf install -y gcc glibc-devel make python3 util-linux btrfs-progs
fi

make

python3 -m unittest -v || {
    if [ -n "${DEBUG:-}" ]; then
        echo "Tests failed; run this to debug: podman exec -itl bash"
        sleep infinity
    fi
    exit 1
}
EOF