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

use container network if nested_docker #64

Closed
wants to merge 1 commit into from
Closed

use container network if nested_docker #64

wants to merge 1 commit into from

Conversation

alelindq
Copy link

@alelindq alelindq commented Feb 25, 2022

Trying host-to-container mode first does not work if using docker in docker. will hopefully fix #46

trying host-to-container mode first does not work if using docker in docker
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #64 (320f9c6) into master (11b13f6) will increase coverage by 0.71%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
lib/beaker/hypervisor/docker.rb 84.71% <75.00%> (+0.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11b13f6...320f9c6. Read the comment docs.

@bastelfreak
Copy link
Member

@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')
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

@trevor-vaughan trevor-vaughan left a 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.

@alelindq
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rake beaker fail when using beaker-docker 0.8.4 in a docker in docker environment
3 participants