Comments (13)
Hi @lowski,
There's progress, you can now map a local domain to a URL:
hotel add http://192.168.100.99:80 -n my-docker
# http://my-docker.dev -> http://192.168.100.99:80
But you would still need to start manually your docker container (or add it to hotel and start it manually from the UI after that).
Isn't it possible to bind the container to localhost?
from hotel.
I tried this:
- Installed Docker on Mac https://www.docker.com/products/docker#/mac
- created a
Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get -y install python
RUN apt-get clean
EXPOSE 8000
CMD [ "python", "-m", "SimpleHTTPServer" ]
By default SimpleHTTPServer listens to 8000, so I've not set it again in the command.
Finally, I've run the following commands:
$ docker build -t python-test .
$ hotel add 'docker run -p $PORT:8000 python-test'
and it works. Let me know if I'm missing something.
from hotel.
I'm not so familiar with docker containers so let met know if it's missing something.
But if you start them using a command and they have a fixed port, you can add them this way for example:
hotel add -n docker -p service_port 'docker_command'
http://docker.dev will start container using docker_command
and proxy request to http://127.0.0.1:service_port
from hotel.
Docker containers start with a command line option but to access them locally they are attached to a specific ip address and port. In my case 192.168.100.99:80 .. i'm struggling trying to figure out the add syntax that will work with this but i desperately want it to work lol.
from hotel.
@brad-decker thank you for the feedback.
Right now, hotel only supports servers binding to localhost. But supporting other cases, like yours, is on the roadmap :) (i.e. being able to have domain.dev proxy requests to x.x.x.x:PORT)
Maybe if you can make your docker containers start on $PORT and bind to localhost, but I guess if you're asking for such a feature it's because you can't change the IP/port.
from hotel.
Any progress on that?:)
from hotel.
@typicode thanks for the info. That's a good start.
The problem with Docker on OS X is related to inability to run docker natively; you need VM (virtualbox, vmware, xhyve, etc.) with Linux where Docker daemon can be run.
from hotel.
Added an issue for this. I'm thinking about this:
hotel add 'docker-cmd' --port 80 --host 192.168.100.99
@lowski Do you think it would enough?
from hotel.
@typicode I think it should work. If you have the code somewhere (temp branch or something) I can try it out (most probably during the weekend).
from hotel.
Great thanks for the feedback and offering help, I appreciate :)
Not yet, but I think I have a pretty good idea how to do it so maybe not this weekend but soon
from hotel.
@lowski do you have a simple docker command that I can use to test?
from hotel.
@typicode if you have python docker image you can use: python -m SimpleHTTPServer 8000
. Remember to expose the port (8000
).
from hotel.
@typicode solid example (assuming Docker for Mac). I just came across this thread but I think it may help to the shed some light on @brad-decker's original question and said example.
I believe @brad-decker is referencing a "non-native" Docker setup (basically anything besides Linux) where Docker is running in a Linux VM instead of directly on the host machine. Before Docker for Mac/Windows was released this was the only way to run Docker in that environment. Now (I can only speak directly on Docker for Mac) the networking is handled transparently and any ports that are exposed on a container, eg: -p $PORT:8000
are automagically forwarded and accessible on the host machine. This is why the example you posted simply works.
I believe you can probably refer to said example going forward in reference to Docker support for Hotel. There are some networking intricacies with Docker that will always exist and probably differ slightly based on platform but I believe the intentions of the Docker team are to make that part of the networking layer as seamless as possible going forward. It may also be worth deciding whether you want to claim support for anything besides the now "official" solutions for running Docker on all supported platforms to simplify any Docker specific Hotel documentation.
from hotel.
Related Issues (20)
- How to uninstall HOT 1
- ERR_CONNECTION_REFUSED HOT 1
- Proxy servers without starting them? HOT 2
- Path segments after service name not proxying correctly
- Add exceptions for Top Level Domains (TLD) HOT 3
- [FEATURE] pass by environment name of current app HOT 1
- [PROBLEM] Few problems - proxy on chrome, invalid host header with create-react-app
- ERR_INVALID_ARG_TYPE on macOS 10.15 node v14.1.0 HOT 4
- Anyone know a solid alternative? Too many crashes these days... HOT 3
- Typ
- ERR_CONNECTION_REFUSED HOT 2
- Allow overwriting CORS headers for remote server proxies
- Big Sur - LaunchAgents - Load error 5: input/output error HOT 4
- [bug] Doesn't start when use node 14 HOT 4
- Socket hang up error with multiple subdomains Ubuntu 20.04 HOT 1
- ERR_CONNECTION_REFUSED / Connection refused on Windows 10 HOT 1
- Is there a way to change the configuration folder path?
- Run1
- Hotel server not created on M1 mac
- SSL cert.pem and key.pem are not installed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hotel.