File: build_docker.sh

package info (click to toggle)
baler 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 207,900 kB
  • sloc: python: 2,468; sh: 98; makefile: 7
file content (22 lines) | stat: -rwxr-xr-x 494 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -e

# This script serves as a wrapper around docker build to build the docker image
# And is run in the GitHub Actions workflow

DOCKERFILE="${DOCKERFILE:-Dockerfile}"
ARCH="${ARCH:-$(uname -m)}"
TAG="baler-${ARCH}:latest"

if ! [ -x "$(command -v docker)" ]; then
  echo 'Error: docker is not installed.' >&2
  exit 1
fi

if [ "${ARCH}" = "arm64" ]; then
  DOCKERFILE="${DOCKERFILE}.${ARCH}"
fi

docker build -t ${TAG} -f "${DOCKERFILE}" .
echo "Successfully built ${TAG}..."