diff --git a/application/src/main/data/json/edge/install_instructions/docker/instructions.md b/application/src/main/data/json/edge/install_instructions/docker/instructions.md index 37bf52c8cc..6b93447851 100644 --- a/application/src/main/data/json/edge/install_instructions/docker/instructions.md +++ b/application/src/main/data/json/edge/install_instructions/docker/instructions.md @@ -36,7 +36,7 @@ version: '3.0' services: mytbedge: restart: always - image: "thingsboard/tb-edge:latest" + image: "thingsboard/tb-edge:${TB_EDGE_VERSION}" ports: - "8080:8080" - "1883:1883" diff --git a/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java b/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java index dca5a768a4..5a602a5a14 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java @@ -52,6 +52,9 @@ public class DefaultEdgeInstallService implements EdgeInstallService { @Value("${edges.rpc.ssl.enabled}") private boolean sslEnabled; + @Value("${app.version:unknown}") + private String appVersion; + @Override public EdgeInstallInstructions getDockerInstallInstructions(TenantId tenantId, Edge edge, HttpServletRequest request) { String dockerInstallInstructions = readFile(resolveFile("docker", "instructions.md")); @@ -64,6 +67,7 @@ public class DefaultEdgeInstallService implements EdgeInstallService { dockerInstallInstructions = dockerInstallInstructions.replace("${LOCALHOST_WARNING}", ""); dockerInstallInstructions = dockerInstallInstructions.replace("${BASE_URL}", baseUrl); } + dockerInstallInstructions = dockerInstallInstructions.replace("${TB_EDGE_VERSION}", appVersion + "EDGE"); dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_ROUTING_KEY}", edge.getRoutingKey()); dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_ROUTING_SECRET}", edge.getSecret()); dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_RPC_PORT}", Integer.toString(rpcPort));