-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
use container network if nested_docker #64
Conversation
trying host-to-container mode first does not work if using docker in docker
Codecov Report
@@ Coverage Diff @@
## master #64 +/- ##
==========================================
+ Coverage 84.00% 84.71% +0.71%
==========================================
Files 1 1
Lines 300 301 +1
==========================================
+ Hits 252 255 +3
+ Misses 48 46 -2
Continue to review full report at Codecov.
|
@trevor-vaughan ping :) I this something you can review or test? |
ip = network_settings['IPAddress'] | ||
port = 22 if ip && !ip.empty? | ||
port22 = network_settings.dig('PortBindings','22/tcp') | ||
if port22.nil? && network_settings.key?('Ports') |
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.
The if
statement is unnecessary and the following line could be changed to:
port22 ||= network_settings.dig('Ports','22/tcp')
if port22.nil? && network_settings.key?('Ports') | ||
port22 = network_settings.dig('Ports','22/tcp') | ||
end | ||
ip = port22[0]['HostIp'] if port22 |
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.
HostIp
could be empty so you're going to want to fall back to IPAddress
as in the removed code if necessary.
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 needs to be evaluated against a podman
instance.
The changes may work but we probably need to retain the IPAddress/Port 22 default fallback if nothing else works.
For instance, using podman run --rm --expose 22 --it ubuntu
, the following is returned:
"IPAddress": "1.2.3.4",
"PortBindings": {
"22/tcp": null
}
After fighting with this for a LONG time previously, I definitely recommend the fallback and then setting things more appropriately if you can actually discover what's going on.
No longer have this issue after upgrade to version 1.5.0. Don't think this PR is relevant or useful anymore so will close it. |
Trying host-to-container mode first does not work if using docker in docker. will hopefully fix #46