UrbanCode / UCD-Docker-Images

This project contains build scripts and Docker related utilities for creating Docker images (Dockerfiles) of UrbanCode Deploy.
Apache License 2.0
12 stars 23 forks source link

UCD-Agent offline after container restart #9

Closed s3n29t closed 7 years ago

s3n29t commented 7 years ago

If I do a restart of the UDC Agent Container, then the previous Agent connection in UDC Deploy Server is offline and a new agent is automatically registered. In Description with the message "Error: New name agent-0f475ec59174 is already in use by another agent". Is there no way to connect the initially created agent?

Thanks for helping.

Regards Peter

ibm_urbancode_deploy__ressourcen

nhmathis commented 7 years ago

Hi @s3n29t,

This issue is being resolved with pull request #11!

-Nick

nhmathis commented 7 years ago

Today DockerHub UCD v6.2.5.2.929926 images have been released and PR #11 has been merged. Now you can specify an AGENT_NAME environment variable to persist agents between docker starts and stops.

LongLiveCHIEF commented 6 years ago

This needs to be re-opened. #11 did not fix this. The agentStart.sh file used for the container entrypoint removes the agent.id property as the very first step.

This causes a new agentID to be generated on each container start, which still triggers the autogeneration of a new agent resource using agent-[agent.id] as the agent name in the uc server resource list.

nhmathis commented 6 years ago

If you uncomment line 24 in the docker-compose.yaml file and then rebuild the docker-compose containers, does that resolve your issue? You can give the agent any name you would like.

Uncomment this line: https://github.com/IBM-UrbanCode/UCD-Docker-Images/blob/222ae2de6be40fe21ecfe1f876c20c05f60b20b3/compose/Deploy/docker-compose.yaml#L24

By default, an agent without an id will generate a new id on each agent start time. Therefore, by giving it a name, it will have an ID to associate with it's configuration.