I want to squash my docker image so that I can remove intermediate containers that contain secrets. Docker allows you to do this with the squash flag:
docker build -t $IMAGE_NAME --build-arg SECRET_KEY=$SECRET_KEY --squash .
The problem is pipelines doesn't have experimental features enabled:
"--squash" is only supported on a Docker daemon with experimental features enabled
Is there a way to enable these features for Docker in Bitbucket Pipelines?
Hi Keith,
Currently we do not support having Docker run in experimental mode. You can open a feature request for it to be supported.
The Docker team recommends you use multi-stage builds instead of squash to remove intermediate layers. There have also been some discussions around remove the squash flag too. Multi-stage builds are supported in Pipelines.
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.