-
Notifications
You must be signed in to change notification settings - Fork 180
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
chore(protocol-designer): forward dev docker port #17270
Conversation
Added support to allow docker container forward to the host system.
@@ -47,10 +47,13 @@ benchmarks: | |||
node ../scripts/runBenchmarks "./benchmarks/*.js" | \ | |||
ntee "./benchmarks/output/$(benchmark_output)" | |||
|
|||
dev_port ?= 5178 |
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.
pd specifies the port number in vite.config so don't need to specify the port number in Makefile.
server: {
port: 5178
}
@@ -47,10 +47,13 @@ benchmarks: | |||
node ../scripts/runBenchmarks "./benchmarks/*.js" | \ | |||
ntee "./benchmarks/output/$(benchmark_output)" | |||
|
|||
dev_port ?= 5178 | |||
dev_host ?= 0.0.0.0 |
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.
Is there any reason that you want to specify the host?
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.
host IP set to 0.0.0.0 allows to expose port in docker container.
Please discard the request if it will cause a conflict.
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'm not sure what you are trying to do, but localhost should work for Docker.
We don't maintained Dockerfile regularly, but that is available.
https://github.com/Opentrons/opentrons/blob/edge/Dockerfile
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 don't use Docker much so I'm not sure, but off the top of my head, I agree with Koji. Localhost feels like it should work, and if it doesn't work, that feels like something that can be fixed in the Docker config.
The reason I'm wary of just setting this to 0.0.0.0 to get it to work is that it'll expose the server to the network, which doesn't seem like good default behavior from a security perspective. Especially not for robot-server (in the other PR), which unfortunately grants clients arbitrary code execution.
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.
when this is being run in a docker container, it does need to accept connections from outside because outside means "outside the docker container". it's a reasonable need, so let's keep the variable. however, @anuwrag the default value should be localhost or 127.0.0.1.
@@ -47,10 +47,13 @@ benchmarks: | |||
node ../scripts/runBenchmarks "./benchmarks/*.js" | \ | |||
ntee "./benchmarks/output/$(benchmark_output)" | |||
|
|||
dev_port ?= 5178 | |||
dev_host ?= 0.0.0.0 |
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.
when this is being run in a docker container, it does need to accept connections from outside because outside means "outside the docker container". it's a reasonable need, so let's keep the variable. however, @anuwrag the default value should be localhost or 127.0.0.1.
The 127.0.0.1 doesn't directly work with port forwarding on Docker and I could only get 0.0.0.0 working. |
Added support to allow docker container forward to the host system.
Overview
Test Plan and Hands on Testing
Changelog
Review requests
Risk assessment