Fleet Connect To Docker Java dev image
Hi, I am trying to use Fleet to connect to a Java dev image based on eclipse-temurin with macOS. The image is built, and runs fine such that when I start it manually I am connected to the bash shell. See below.
I really don't know what to expect when I connect to a dev image from Fleet, so I don't know whether and how this is supposed to work.
What I want is to access the code mounted within the dev container, as illustrated below, and to be able to run the gradle build and so on in that dev container.
Is there a overview of how the Fleet/Docker container experience is supposed to work please?
My Dockerfile_dev is:
FROM eclipse-temurin
CMD ["/bin/bash"]
I can build and run like this:
docker build -t $STRUCTURIZR_DEV_DKR_TAG -f Dockerfile_dev .
docker run -it --rm -v $STRUCTURIZR_DEV_DIR:/structurizr-onpremises $STRUCTURIZR_DEV_DKR_TAG
Such that I end up at the prompt of the running container.
Many thanks
Nathan
Please sign in to leave a comment.
To partly answer this question, If I run with arguments “-dit”, then I can access the container with a terminal in Fleet. The default appears to be “-d”.
Using the -v option, to mount the volume with the code using an environment variable to identify the path to be mounted, appears not to work though.
I am running Fleet via the CLI in a shell that has the ENV variables set, so those variables *should* be picked up and passed through to the container invocation, but it is quite possible that this is not happening.
If I use the same -v with an absolute path, instead of an environment variable, then it does work.
How are these variables set? Fleet picks up variables on launch, and if the variables were set interactively - then Fleet wouldn't see them.