It uses Docker to manage the installed dependencies, so you can build your own Docker image with whatever you need and then use that in the pipeline configuration: https://confluence.atlassian.com/bitbucket/use-docker-images...
If I understand right the thing you're expected to provide to run inside "pipelines" is a container in which your build can be performed; the output of that build might also be a Docker container, but hopefully there is not a requirement that it be the same container in which you are performing the build. Or you might be shipping something completely different, totally unrelated to Docker, as your build output that gets sent onward to production. Of course all of this is just a guess, it will become more clear as some of us start to enter the beta program.