diff --git a/src/images/enclave/Dockerfile b/src/images/enclave/Dockerfile index 767d93d2..f32a3297 100644 --- a/src/images/enclave/Dockerfile +++ b/src/images/enclave/Dockerfile @@ -2,6 +2,8 @@ FROM scratch LABEL org.opencontainers.image.source=https://github.com/tkhq/qos ARG BIN ARG EIF +VOLUME /run/nitro_enclaves +VOLUME /var/log/nitro_enclaves COPY ${BIN} /qos_enclave COPY ${EIF} /nitro.eif ENTRYPOINT ["/qos_enclave"] diff --git a/src/qos_enclave/src/main.rs b/src/qos_enclave/src/main.rs index a7c35fb7..2ccac9d4 100644 --- a/src/qos_enclave/src/main.rs +++ b/src/qos_enclave/src/main.rs @@ -86,11 +86,15 @@ fn boot() -> String { }; println!("{:?}", run_args); - // Socket directory must exist or Nitro SDK crashes with generic error + // Socket/log directories must exist or Nitro SDK crashes generically if !Path::new("/run/nitro_enclaves").is_dir() { create_dir_all("/run/nitro_enclaves") .expect("Failed to create /run/nitro_enclaves"); } + if !Path::new("/var/log/nitro_enclaves").is_dir() { + create_dir_all("/var/log/nitro_enclaves") + .expect("Failed to create /var/log/nitro_enclaves"); + } let logger = init_logger() .map_err(|e| e.set_action("Logger initialization".to_string()))