Use CI made Docker image with privileges enabled to build images

This commit is contained in:
Igor Pecovnik
2021-11-22 13:17:47 +01:00
parent cd83aea300
commit e2bc820bdb

View File

@@ -18,7 +18,7 @@ else
# build a new container based on provided Dockerfile
display_alert "Docker container not found or out of date"
display_alert "Building a Docker container"
if ! docker build -t armbian:$VERSION . ; then
if ! docker build -t ghcr.io/armbian/build:$VERSION . ; then
STATUS=$?
# Adding a newline, so the alert won't be shown in the same line as the error
echo
@@ -31,7 +31,7 @@ DOCKER_FLAGS=()
# Running this container in privileged mode is a simple way to solve loop device access issues
# Required for USB FEL or when writing image directly to the block device, when CARD_DEVICE is defined
#DOCKER_FLAGS+=(--privileged)
DOCKER_FLAGS+=(--privileged)
# add only required capabilities instead (though MKNOD should be already present)
# CAP_SYS_PTRACE is required for systemd-detect-virt in some cases
@@ -106,10 +106,10 @@ If you prefer to use profile, for example, `userpatches/config-my.conf`, try:
./compile.sh my compile_uboot
EOF
docker run "${DOCKER_FLAGS[@]}" -it --rm --entrypoint /usr/bin/env armbian:$VERSION "$@" /bin/bash
docker run "${DOCKER_FLAGS[@]}" -it --rm --entrypoint /usr/bin/env ghcr.io/armbian/build:$VERSION "$@" /bin/bash
else
display_alert "Running the container" "" "info"
docker run "${DOCKER_FLAGS[@]}" -it --rm armbian:$VERSION "$@"
docker run "${DOCKER_FLAGS[@]}" -it --rm ghcr.io/armbian/build:$VERSION "$@"
fi
# Docker error treatment