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

Change docker default port to support windows and boot2docker #225

Merged
merged 9 commits into from
Oct 9, 2015

Conversation

cbednarski
Copy link
Contributor

  • In dev/test, Docker socket config can be customized using DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH to facilitate development and testing on Windows and OSX using boot2docker or a VM
  • In production nomad reads the docker.endpoint config option, and falls back on a platform-specific default.

If merged, this also closes #141

//
// Also note that we need to turn on DevMode in the test configs.
if d.config.DevMode {
return docker.NewClientFromEnv()
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like if this returns an error we should try and use the default Docker host.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it makes sense to do this. If you are on e.g. windows and have misconfigured your DOCKER_HOST setting then this should reasonably be expected to fail. I want to know if my config is wrong, rather than having it be magically replaced by something else.

We will use the defaults if you have not specified anything.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah didn't see the part were it falls back. That is really what I wanted. That happens in NewClientFromEnv?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you have to dig into the calls but it eventually calls getDefaultDockerHost() in go-dockerclient which does basically the same thing you see in getDefaultDockerHost in docker.go. It's private so I had to copy-pasta. I should probably change it to public and upstream that one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's private so I had to copy-pasta. I should probably change it to public and upstream that one.

That PR is here: fsouza/go-dockerclient#394

@@ -33,15 +35,54 @@ type dockerHandle struct {
doneCh chan struct{}
}

// getDefaultDockerHost is copied from fsouza. If it were exported we woudn't
// need this here.
func getDefaultDockerHost() (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like your PR has been merged so we should remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! Testing that change locally.

@cbednarski
Copy link
Contributor Author

Tests are passing locally (OS X and linux):

$ go test ./client/driver/... -run .*Docker.*
ok      github.com/hashicorp/nomad/client/driver    48.682s
ok      github.com/hashicorp/nomad/client/driver/args   0.002s
ok      github.com/hashicorp/nomad/client/driver/environment    0.002s

@sethvargo
Copy link
Contributor

@cbednarski I think @dadgar was going to take a look at #236 to see what those three tests are failing on Travis

@dadgar
Copy link
Contributor

dadgar commented Oct 8, 2015

LGTM

cbednarski added a commit that referenced this pull request Oct 9, 2015
Change docker default port to support windows and boot2docker
@cbednarski cbednarski merged commit 6c90314 into master Oct 9, 2015
@cbednarski cbednarski deleted the b-docker-port branch October 9, 2015 06:50
@cbednarski cbednarski restored the b-docker-port branch October 27, 2015 19:59
@cbednarski cbednarski deleted the b-docker-port branch October 27, 2015 20:00
benbuzbee pushed a commit to benbuzbee/nomad that referenced this pull request Jul 21, 2022
Clean up temporary snapshots when there are errors
@github-actions
Copy link

github-actions bot commented May 6, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants