I have been trying to create an agent that will be able to use openjdk-11 instead of openjk-1.8. I downloaded the "jetbrains/teamcity-agent:latest" image from the docker hub for ubuntu 20.04 and ran the following script:
docker run -rm -it --name teamcity-agent-instance \
-e SERVER_URL="<server-url>" \
-v /mnt/f/teamcity/project/agent:/data/teamcity_agent/conf/ \
After running this I then entered the docker container with the following:
docker exec -it -u root teamcity-agent-instance bash
I then proceeded to install openjdk-11 which is saved in the path "/usr/lib/jvm/java-11-openjdk-amd64". Once this was installed, I committed a new docker image based off this container called "jetbrains/teamcity-agent:java11".
When I started the new image as an agent, it still reverted to using openjdk-1.8. I checked inside the new container instance and openjdk-11 was still there. I wondered if there was a way to add something to the "buildAgent.properties" file that is shared between the docker container and my host machine. I tried
But again it still said that it was using openjdk-1.8. Could this be that I am trying to use / set the wrong env.XXXX variable in the properties file or is this not the correct way to do this?
The only way I have managed to get the agent to use openjdk-11 is to enter the running container and delete "/opt/java". But this doesn't feel like the correct solution in the event that I want the agent to keep its java8 version. Also, if I do this method then the JAVA_HOME variables are not correctly set.
Any advice would be greatly appreciated!