pull/34154/head
Maxime Desroches 5 months ago
parent a9575bc33e
commit 137cde5fc9
  1. 9
      selfdrive/test/docker_build.sh
  2. 1
      selfdrive/test/docker_common.sh

@ -19,6 +19,15 @@ source $SCRIPT_DIR/docker_common.sh $1 "$TAG_SUFFIX"
DOCKER_BUILDKIT=1 docker buildx build --provenance false --pull --platform $PLATFORM --load --cache-to type=inline --cache-from type=registry,ref=$REMOTE_TAG -t $DOCKER_IMAGE:latest -t $REMOTE_TAG -t $LOCAL_TAG -f $OPENPILOT_DIR/$DOCKER_FILE $OPENPILOT_DIR DOCKER_BUILDKIT=1 docker buildx build --provenance false --pull --platform $PLATFORM --load --cache-to type=inline --cache-from type=registry,ref=$REMOTE_TAG -t $DOCKER_IMAGE:latest -t $REMOTE_TAG -t $LOCAL_TAG -f $OPENPILOT_DIR/$DOCKER_FILE $OPENPILOT_DIR
if [ -n "$DOCKER_MAX_SIZE" ]; then
SIZE="$(docker inspect $DOCKER_IMAGE:latest --format='{{.Size}}')"
echo "$DOCKER_IMAGE size: $SIZE bytes"
if [ $(echo "$SIZE > $DOCKER_MAX_SIZE" | bc) -eq 1 ]; then
echo "Image too large, max is $DOCKER_MAX_SIZE bytes"
exit 1
fi
fi
if [ -n "$PUSH_IMAGE" ]; then if [ -n "$PUSH_IMAGE" ]; then
docker push $REMOTE_TAG docker push $REMOTE_TAG
docker tag $REMOTE_TAG $REMOTE_SHA_TAG docker tag $REMOTE_TAG $REMOTE_SHA_TAG

@ -1,6 +1,7 @@
if [ "$1" = "base" ]; then if [ "$1" = "base" ]; then
export DOCKER_IMAGE=openpilot-base export DOCKER_IMAGE=openpilot-base
export DOCKER_FILE=Dockerfile.openpilot_base export DOCKER_FILE=Dockerfile.openpilot_base
export DOCKER_MAX_SIZE="7.1*10^9"
elif [ "$1" = "prebuilt" ]; then elif [ "$1" = "prebuilt" ]; then
export DOCKER_IMAGE=openpilot-prebuilt export DOCKER_IMAGE=openpilot-prebuilt
export DOCKER_FILE=Dockerfile.openpilot export DOCKER_FILE=Dockerfile.openpilot

Loading…
Cancel
Save