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

Can't bind to private address on host #492

Closed
1 of 3 tasks
michalno1 opened this issue Nov 23, 2022 · 3 comments · Fixed by #1091
Closed
1 of 3 tasks

Can't bind to private address on host #492

michalno1 opened this issue Nov 23, 2022 · 3 comments · Fixed by #1091

Comments

@michalno1
Copy link

michalno1 commented Nov 23, 2022

Description

After moving from Docker for Mac to Colima I noticed that I can no longer publish to a private address on the host. For example, assuming the private address of my mac is 192.168.1.17, this works on Docker for Mac:

docker run --privileged --tty --publish=192.168.1.17:59424:6443/TCP kindest/node:v1.23.4

but it doesn't work on colima:

docker: Error response from daemon: driver failed programming external connectivity on endpoint heuristic_leakey (b3989fd86d3b82abed9e160d7e2292a41a4f9f65a80500e8d82a8ee5ca1a2b70): Error starting userland proxy: listen tcp4 192.168.1.17:59424: bind: cannot assign requested address.

Version

Colima Version: 0.4.6
Lima Version: 0.13.0
Qemu Version: 7.1.0

Operating System

  • macOS Intel
  • macOS M1
  • Linux

Expected behaviour

I would expect to be able to bind to private address on the host.

@abiosoft
Copy link
Owner

The network behaviour is a bit different to Docker Desktop but it can be made to work. If at all this is done, it will only support the network interface for the default route.

What is the main use case for this? Limiting access to devices on the LAN?

@inabhi9
Copy link

inabhi9 commented Dec 29, 2022

@abiosoft what do you mean by support the network interface for the default route?
I'm also interested in the feature and yes, use case is limiting access on LAN.

For now, I patched the latest source to accept port interface (which was available somewhere in v0.3) and pass it to port forwards.

However, I'm curious if it can be done similar to Docker like ability to pass down host interfaces to VM.

@abiosoft
Copy link
Owner

abiosoft commented Aug 2, 2024

This feature is now implemented and would be part of the next release.

To try it now:

# remove stable version
brew uninstall colima

# install development version
brew install --head colima

tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Aug 10, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [abiosoft/colima](https://github.com/abiosoft/colima) | patch | `v0.7.0` -> `v0.7.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>abiosoft/colima (abiosoft/colima)</summary>

### [`v0.7.1`](https://github.com/abiosoft/colima/releases/tag/v0.7.1)

[Compare Source](abiosoft/colima@v0.7.0...v0.7.1)

#### Highlights

This is an incremental release with bug fixes.

-   Interrupted disk image download will now resume on subsequent `colima start`.
-   Docker container port mapping to specific host IP addresses is now supported.

For more details about v0.70 features, check [v0.70 release notes](https://github.com/abiosoft/colima/releases/tag/v0.7.0).

#### Other Fixes

-   Disk image downloader no longer duplicating downloads. Fixes [#&#8203;1098](abiosoft/colima#1098)
-   Support for binding to host IP address in containers. Fixes [#&#8203;492](abiosoft/colima#492)
-   Ensure proper loading of docker deamon settings on startup. Fixes [#&#8203;902](abiosoft/colima#902)
-   Running multiple Colima profiles with k3s enabled. Fixes [#&#8203;1087](abiosoft/colima#1087)

#### Commits

-   k3s: use random port for cluster API by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1088
-   k3s: re-use default port for existing instances by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1090
-   net: support forwarding to specific host IP addresses by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1091
-   core: nested virtualization and other fixes by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1094
-   build(deps): bump golang.org/x/term from 0.22.0 to 0.23.0 by [@&#8203;dependabot](https://github.com/dependabot) in abiosoft/colima#1095
-   fix(docker): apply configuration on first boot by [@&#8203;milas](https://github.com/milas) in abiosoft/colima#1097
-   core: fix downloader duplicating downloads by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1099
-   core: update disk images by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1102

**Full Changelog**: abiosoft/colima@v0.7.0...v0.7.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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

Successfully merging a pull request may close this issue.

3 participants