Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to integrate docker-slim with bitbucket pipeline

ssharar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 8, 2026

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 $BASENAME/$PROJECT:${SLIM_IMAGE_TAG} \
--target $BASENAME/$PROJECT:${IMAGE_TAG} \
--http-probe=true \

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events