Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create required nitro dirs at the daemon and container level #331

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/images/enclave/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these volumes get created when the docker image is run?

COPY ${BIN} /qos_enclave
COPY ${EIF} /nitro.eif
ENTRYPOINT ["/qos_enclave"]
Expand Down
6 changes: 5 additions & 1 deletion src/qos_enclave/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down