Label running containers

This will avoid issues where `dokku cleanup` removes the stopped containers (it should not do so, and instead should allow them to stay in stopped mode).

Containers will be labeled as follows:

- service: dokku=service dokku.service=SERVICE_NAME
- ambassador: dokku=ambassador dokku.ambassador=SERVICE_NAME

To destroy the containers, simply run the `service:destroy` command.
This commit is contained in:
Jose Diaz-Gonzalez
2015-09-06 19:29:28 -04:00
parent 2289c5f3dc
commit f72bf5402d
2 changed files with 2 additions and 2 deletions

View File

@@ -175,7 +175,7 @@ service_port_unpause() {
echo "${PORTS[@]}" > "$PORT_FILE"
docker run -d --link "$SERVICE_NAME:redis" --name "$EXPOSED_NAME" $(docker_ports_options "${PORTS[@]}") --restart always svendowideit/ambassador > /dev/null
docker run -d --link "$SERVICE_NAME:redis" --name "$EXPOSED_NAME" $(docker_ports_options "${PORTS[@]}") --restart always --label dokku=ambassador --label dokku.ambassador=redis svendowideit/ambassador > /dev/null
if [[ "$LOG_FAIL" == "true" ]]; then
dokku_log_info1 "Service $SERVICE exposed on port(s) ${PORTS[*]}"
fi