Skip to content

mint sensor writing to unauthorized directory in bitbucket pipeline #833

Description

@Sharar294

Overview

Hi, I'm trying to integrate docker slim to reduce the size of docker images. I have a pipe.sh script in a repo that creates and pushes docker images to dockerhub. In this pipe.sh I'm building the regular docker image first and then slimming it right after.

Problem

Since the only writeable path is any subdirectory of BITBUCKET_CLONE_DIR, I made a subdirectory called "slim-state" which is where docker-slim writes some metadata. Even after doing this I'm getting this error:

level=fatal msg="slim: failure" error="API error (403): authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories"

This is how I'm using slim:

echo "Running docker-slim on image..."
SLIM_IMAGE_TAG=${IMAGE_TAG}-slim
SLIM_STATE_DIR="$BITBUCKET_CLONE_DIR/slim-state"
mkdir -p ${SLIM_STATE_DIR}
slim
--verbose
--debug
--state-path ${SLIM_STATE_DIR}
build
--tag $NAME:${SLIM_IMAGE_TAG}
--target $NAME:${IMAGE_TAG}
--http-probe=true \

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions