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

🐛 BUG: Running dev server in Windows on a node Docker container fails #3782

Closed
1 task done
ran-dall opened this issue Jul 1, 2022 · 1 comment
Closed
1 task done
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@ran-dall
Copy link
Contributor

ran-dall commented Jul 1, 2022

What version of astro are you using?

1.0.0-beta.59

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows, Linux

Describe the Bug

Ref: https://discord.com/channels/830184174198718474/991708338301718558

During a support session, @aFuzzyBear and I were working on an HMR issue from @tusamni, we discovered that when running Astro from within a container on Windows, it isn't possible to connect from a browser on the host using the localhost address. I reproduced this behavior with both the Docker Community node image and Red Hat's node UBI image; furthermore, I was able to successfully connect to localhost using the Docker Community nginx image.

Curiously enough, this only happens on Windows and does not happen on Linux.

In all the following examples, localhost works in Linux, but it does not work on Windows.

(First, clone the site to any folder of your choice, then switch into that directory in a terminal prompt.)

$ podman run -it --rm --network host --user root --volume $(pwd):/mnt/site --workdir /mnt/site node:latest /bin/bash
$ docker run -it --rm --network host --user root --volume $(pwd):/mnt/site --workdir /mnt/site node:latest /bin/bash
$ podman run -it --rm --network host --user root --volume $(pwd):/mnt/site --workdir /mnt/site registry.access.redhat.com/ubi8/nodejs-16:latest /bin/bash
$ docker run -it --rm --network host --user root --volume $(pwd):/mnt/site --workdir /mnt/site registry.access.redhat.com/ubi8/nodejs-16:latest /bin/bash

Link to Minimal Reproducible Example

https://github.com/tusamni/astro-blog-portfolio

Participation

  • I am willing to submit a pull request for this issue.
@tony-sull tony-sull added - P3: minor bug An edge case that only affects very specific usage (priority) s2-medium labels Jul 1, 2022
@natemoo-re natemoo-re self-assigned this Jul 7, 2022
@natemoo-re natemoo-re removed their assignment Sep 6, 2022
@bluwy
Copy link
Member

bluwy commented Oct 17, 2022

Astro uses the Vite dev server, so I think this should be an issue for Vite. vitejs/vite#4116 might have some hints to help with this.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

4 participants