-
Notifications
You must be signed in to change notification settings - Fork 97
feat: support connecting to a pocket-ic server running inside a Docker container. #4271
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
base: master
Are you sure you want to change the base?
Conversation
…stead of 0.0.0.0 for pocket-ic server.
…the temporary frontend address solution.
if std::process::Command::new("docker") | ||
.args(["--version"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if the command is available, docker might still fail if the daemon is not running.
@@ -286,6 +342,8 @@ fn pocketic_start_thread( | |||
} | |||
} | |||
}; | |||
println!("port: {}", port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left-over debug output?
"-p", | ||
format!("{}:{}", bind_address.port(), bind_address.port()).as_str(), | ||
"-p", | ||
"8081:8081", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes a fixed port on the host without an option to override.
bind_address = convert_to_docker_bind_address(bind_address); | ||
cmd.args([ | ||
"-p", | ||
format!("{}:{}", bind_address.port(), bind_address.port()).as_str(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside the container a fixed port could be used for simplicity.
let output = std::process::Command::new("docker") | ||
.args(["exec", container_id.as_str(), "cat", "pocket-ic-port"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the (host) port retrieved from the docker container? I'd expect the host port to be stored on the host and mapped to a (fixed) port used in the docker container.
"8081:8081", | ||
]); | ||
cmd.args(["-d", docker_image.as_str()]); | ||
cmd.stdout(std::process::Stdio::piped()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also expect the -v
option to be used in order to mount the state to be persisted.
Description
The pr supports connecting to a pocket-ic server running inside a Docker container.
Fixes # (issue)
How Has This Been Tested?
Manually tested so far by starting, deploying, and stopping.
Checklist: