Compilation on Bitbucket Pipelines using Docker

I think there is a bit of a confusion here: docker run A does not execute program A, it starts a docker instance of an image named “A”. If there is no such image, docker will complain (see docker run haxelib).
When you run a docker image it will call a predefined (= baked into that docker image) command line or script, which can then start a service, run a tool or do whatever.

In the case of Haxe’s docker images that startup script simply calls haxe - an executable that sits inside that image (along with neko and haxelib). So you are both correct.

However in order to get it to call haxelib ... you would have to trick it, e.g. by bypassing the startup script, going interactive or building your own derivative image.

I haven’t used Haxe’s docker images, so I’m not really sure how they are supposed to work.
The readme for Haxe images on docker hub indicates you are meant to build your own image(s) from those Haxe images, so they contain operations tailored to your project. So Haxe’s images are just there to provide the binaries.

You should also keep in mind, that everytime you docker run <image> you start a fresh, new instance, which doesn’t know anything that happened before.

All in all it sounds like a lot of work, and I’m not sure you want to go in that direction.

regarding lix: I think node 4.2.1 is too old, try using a more up to date version. I think I’ve seen someone mentioning at least version 6 was required. I usually go for 10.x.