mirror of
https://github.com/Jackett/Jackett
synced 2025-03-04 18:59:01 +00:00
core: show docker image version in the startup traces (#9521)
https://github.com/linuxserver/docker-jackett/pull/105
This commit is contained in:
parent
8e124d7af8
commit
b4c097fd97
1 changed files with 12 additions and 3 deletions
|
@ -112,9 +112,18 @@ namespace Jackett.Server.Services
|
|||
|
||||
try
|
||||
{
|
||||
var cgroupFile = "/proc/1/cgroup";
|
||||
if (File.Exists(cgroupFile))
|
||||
logger.Info("Running in Docker: " + (File.ReadAllText(cgroupFile).Contains("/docker/") ? "Yes" : "No"));
|
||||
var dockerMsg = "No";
|
||||
const string cgroupFile = "/proc/1/cgroup";
|
||||
if (File.Exists(cgroupFile) && File.ReadAllText(cgroupFile).Contains("/docker/"))
|
||||
{
|
||||
// this file is created in the Docker image build
|
||||
// https://github.com/linuxserver/docker-jackett/pull/105
|
||||
const string dockerImageFile = "/etc/docker-image";
|
||||
dockerMsg = File.Exists(dockerImageFile)
|
||||
? "Yes (image build: " + File.ReadAllText(dockerImageFile).Trim() + ")"
|
||||
: "Yes (image build: unknown)";
|
||||
}
|
||||
logger.Info($"Running in Docker: {dockerMsg}");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue