[GH-ISSUE #27] 【Feature Enhancement】Quickly update the dokemon-agent version on servers #8

Open
opened 2026-03-03 19:10:49 +03:00 by kerem · 1 comment
Owner

Originally created by @aaro-n on GitHub (Jan 14, 2024).
Original GitHub issue: https://github.com/productiveops/dokemon/issues/27

Issue

When the dokemon server version is updated, the corresponding dokemon-agent version on VPS is not automatically updated. Manual updating of dokemon-agent is cumbersome, especially when dealing with a large number of VPS.

Result

The dokemon server can now update the dokemon-agent version on managed VPS with a single click.

Practice

  1. Deploy dokemon-agent on the respective VPS using docker-compose.yml. The docker-compose.yml content is as follows:
version: '3.3'

services:
  dokemon-agent:
    image: productiveops/dokemon-agent:latest
    container_name: dokemon-agent
    restart: always
    environment:
      - SERVER_URL=https://xxx.xxx.xxx
      - TOKEN=112222222
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

Run docker-compose up -d to run in the background. On the dokemon server, you can see that the corresponding VPS is connected.

  1. Add the corresponding VPS's dokemon-agent to the dokemon server. The dokemon server Definition configuration is as follows:
version: '3.3'
services:
  dokemon-agent-zhu:
    image: productiveops/dokemon-agent:latest
    container_name: dokemon-agent-zhu
    restart: always
    environment:
      - SERVER_URL=https://xxx.xxx.xxx
      - TOKEN=11111111
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

Now you can deploy it like a regular Docker image. After running, you can use docker-compose down to shut down the containers from step 1.

  1. Create a backup Definition configuration on the dokemon server, as follows:
version: '3.3'
services:
  dokemon-agent-fu:
    image: productiveops/dokemon-agent:latest
    container_name: dokemon-agent-fu
    restart: always
    environment:
      - SERVER_URL=https://xxx.xxx.xxx
      - TOKEN=11111111
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

Just create it but do not run it.

  1. Update the dokemon-agent on VPS.
    4.1 Update the dokemon-agent image for the corresponding VPS on the dokemon server.
    4.2 Run the backup Definition configuration from step 3 and observe the logs to check if the running version is the latest dokemon-agent.
    4.3 Stop and remove the containers from step 2. At this point, the VPS is running the latest version of dokemon-agent (from step 3).
    4.4 Re-run step 2. The containers created should now run the latest version of dokemon-agent. Stop the containers from step 3 to complete the update of dokemon-agent on VPS.

Other

It would be beneficial to selectively update dokemon-agent on specific VPS instances. It would be ideal to have an environment variable to determine which Definition configuration the VPS is running (identifying the containers from steps 2 and 3).

Originally created by @aaro-n on GitHub (Jan 14, 2024). Original GitHub issue: https://github.com/productiveops/dokemon/issues/27 # Issue When the dokemon server version is updated, the corresponding dokemon-agent version on VPS is not automatically updated. Manual updating of dokemon-agent is cumbersome, especially when dealing with a large number of VPS. # Result The dokemon server can now update the dokemon-agent version on managed VPS with a single click. # Practice 1. Deploy dokemon-agent on the respective VPS using docker-compose.yml. The docker-compose.yml content is as follows: ```yaml version: '3.3' services: dokemon-agent: image: productiveops/dokemon-agent:latest container_name: dokemon-agent restart: always environment: - SERVER_URL=https://xxx.xxx.xxx - TOKEN=112222222 volumes: - /var/run/docker.sock:/var/run/docker.sock ``` Run `docker-compose up -d` to run in the background. On the dokemon server, you can see that the corresponding VPS is connected. 2. Add the corresponding VPS's dokemon-agent to the dokemon server. The dokemon server Definition configuration is as follows: ```yaml version: '3.3' services: dokemon-agent-zhu: image: productiveops/dokemon-agent:latest container_name: dokemon-agent-zhu restart: always environment: - SERVER_URL=https://xxx.xxx.xxx - TOKEN=11111111 volumes: - /var/run/docker.sock:/var/run/docker.sock ``` Now you can deploy it like a regular Docker image. After running, you can use `docker-compose down` to shut down the containers from step 1. 3. Create a backup Definition configuration on the dokemon server, as follows: ```yaml version: '3.3' services: dokemon-agent-fu: image: productiveops/dokemon-agent:latest container_name: dokemon-agent-fu restart: always environment: - SERVER_URL=https://xxx.xxx.xxx - TOKEN=11111111 volumes: - /var/run/docker.sock:/var/run/docker.sock ``` Just create it but do not run it. 4. Update the dokemon-agent on VPS. 4.1 Update the dokemon-agent image for the corresponding VPS on the dokemon server. 4.2 Run the backup Definition configuration from step 3 and observe the logs to check if the running version is the latest dokemon-agent. 4.3 Stop and remove the containers from step 2. At this point, the VPS is running the latest version of dokemon-agent (from step 3). 4.4 Re-run step 2. The containers created should now run the latest version of dokemon-agent. Stop the containers from step 3 to complete the update of dokemon-agent on VPS. # Other It would be beneficial to selectively update dokemon-agent on specific VPS instances. It would be ideal to have an environment variable to determine which Definition configuration the VPS is running (identifying the containers from steps 2 and 3).
Author
Owner

@aaro-n commented on GitHub (Jan 14, 2024):

Translated by GPT-3.5

<!-- gh-comment-id:1890843535 --> @aaro-n commented on GitHub (Jan 14, 2024): Translated by GPT-3.5
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dokemon#8
No description provided.