diff --git a/CHANGELOG.md b/CHANGELOG.md index 61eaa0e..712dfff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ + Readme.md styling tweak, [310a63f4cabaa374797a7e4ed0d7fd1f5e79c8fe] ### Features -+ Use a scratch container for the docker image, should reduce image size by around 60%. This checks for the ENV `OXKER_RUTIME=container`, which is automatically set by the docker image, [17b71b6b41f6a98a0f92277f40a88f4b1b8a1328] ++ Use a scratch container for the docker image, should reduce image size by around 60%. This checks for the ENV `OXKER_RUNTIME=container`, which is automatically set by the docker image, [17b71b6b41f6a98a0f92277f40a88f4b1b8a1328] # v0.2.1 ### 2023-01-29 diff --git a/src/main.rs b/src/main.rs index 32443c0..56b198f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,8 +38,10 @@ use ui::{create_ui, GuiState, Status}; use crate::docker_data::DockerMessage; -// this is the entry point when running as a Docker Container, and is used to check if we are running as a Docker Containerq +// this is the entry point when running as a Docker Container, and is used, in conjunction with the `CONTAINER_ENV` ENV, to check if we are running as a Docker Container const ENTRY_POINT: &str = "./app/oxker"; +const ENV_KEY: &str = "OXKER_RUNTIME"; +const ENV_VALUE: &str = "container"; /// Enable tracing, only really used in debug mode, for now /// write to file if `-g` is set? @@ -52,7 +54,7 @@ fn setup_tracing() { fn check_if_containerised() -> bool { if std::env::vars() .into_iter() - .any(|x| x == ("OXKER_RUNTIME".to_owned(), "container".to_owned())) + .any(|x| x == (ENV_KEY.into(), ENV_VALUE.into())) { std::thread::sleep(std::time::Duration::from_millis(250)); true