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

Fix for undocumented dependency on service name "web" #1

Open
cmeans opened this issue Dec 20, 2020 · 0 comments
Open

Fix for undocumented dependency on service name "web" #1

cmeans opened this issue Dec 20, 2020 · 0 comments

Comments

@cmeans
Copy link

cmeans commented Dec 20, 2020

Hi,

I'm currently evaluating docker-dev for use within my company, and encountered the issue were we'd need to rename the container being exposed to "web".

I was later able to create a PR, but here's the suggested code change:

File: app.go
Replace:

			for _, container := range containers {
				for _, containerName := range container.Names {
					if containerName == expectedContainerName {
						id = container.ID
					}
				}
			}

With:

			if id == "" {
				for _, container := range containers {
					for _, containerPort := range container.Ports {
						if containerPort.PublicPort == uint16(app.Port) {
							id = container.ID
						}
					}
				}
			}

You would then be able to drop the expectedContainerName var also.

It seems to work in my limited testing, but perhaps there's additional issues I'm not aware of.

What do you think?

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

No branches or pull requests

1 participant