okay, I don't know a lot yet either so let's improvise and pls take my comments with a huge grain of salt
my understanding is that Docker is pretty much like a lightweight type of VM like Virtualbox or Qemu except much faster; there's almost no "boot" time and runtime is way faster because binaries talk directly to the host kernel, kindof like WINE.
AFAIK you usually launch individual applications inside a Docker container. I'm not clear yet how daemons/services work inside Docker, like if you can have more than one at a time running.
It's really easy to pull down a Docker image, e.g.:
and then to compile inside it by launching a command from the host.
The host file system is invisible from the container so you usually want to map a host directory (containing your source code files, say) to a path inside the Docker container, so that the compiler tools can see your files. F.ex. I'd do:
Code: Select all
docker run -v /home/plaufenb/bshare:/bshare -it --rm gcc:latest bash
so my files are now available inside the container at /bshare, and then it launches an interactive bash shell inside that container. From then on I can cd into my /bshare directory and compile on the command line.
The Docker instance will be alive until I exit that shell, at which point it's automatically reaped. From the host you can also run a command in an existing Docker instance with 'docker exec' or attach another shell to it with 'docker attach'.
Sooooo... in order to interface with Codelite my guess is that the simplest (brute-force) method would be to manually update CL's build settings e.g.:
Make:
Code: Select all
/usr/bin/make
/docker run --rm $(DOCKER_NAME) /usr/bin/make
C++ compiler
Code: Select all
/usr/bin/clang++
/docker run --rm $(DOCKER_NAME) /usr/bin/clang++
I assume it'd be faster to launch the Docker instance only once at the beginning of the buid and then use 'docker exec' for individual build commands.
Note that while Docker image names do not change (in [name]:[tag] format), Docker
instances have dynamic names, although those can also be set on the command line.
I will try to automate this somehow using CL env variables and see if Codelite can handle Docker just fine as-is. I'll let you know how that goes & any new CL features that I think would make interfacing with Docker easier, maybe to have a 'prefix' command in the build settings.
Debugging an app running inside Docker is a different problem but I'm guessing it's similar to cross-debugging where you expose the GDB server port.
Thx!
-- p