Hi!
I am building calypso with docker and when I run:
npm run build-docker --> it build docker image successfull.
But wen I deploy this image, it error:
Cannot find module 'webpack.config'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
...
Hi @enesyteam
Can I have some more information about what you're trying to achieve. Where and how are you deploying this?
Thanks you!
I'm using windows, build docker with command npm run build-docker and build successfull. Then I deploy this docker by command npm run docker and it error: Cannot find module 'webpack.config' at Function.Module._resolveFilename
Just tested on my macOS laptop and things worked fine (after realizing I had to increase the available RAM to my Docker container). I'll try and get a Windows VM running to test there as well.
Well it turns out that I can't test this because HyperV doesn't run inside a Virtualbox copy of Windows. Maybe @sirreal or @withinboredom or someone who runs Windows natively can test it - sorry if I pinged you two and you don't have Windows
No native windows here, maybe @DanReyLop?
Nope, I don't have any Windows machine here at the moment, sorry. Maybe try in the #windows channel if Rob doesn't have Windows.
_charging the windows machine now_
@enesyteam After looking at the code that builds the docker image, it looks like it _might_ be a path issue. From the root of the repo, if you run the following, does it work (in powershell, untested):
$sha=(git rev-parse HEAD)
docker build --build-arg commit_sha=$sha -t wp-calypso .
docker run -it --name wp-calypso --rm -p 80:3000 wp-calypso
I was able to get it to build and run by ensuring the docker vm had 3GB of ram and the build was the only thing running (my windows machine has 8gb and I had to close nearly everything to get that much memory free).
I used the 3 commands posted above.
_charging the windows machine now_
@enesyteam After looking at the code that builds the docker image, it looks like it _might_ be a path issue. From the root of the repo, if you run the following, does it work (in powershell, untested):
$sha=(git rev-parse HEAD) docker build --build-arg commit_sha=$sha -t wp-calypso . docker run -it --name wp-calypso --rm -p 80:3000 wp-calypso
**docker build --build-arg commit_sha=$sha -t wp-calypso** success:
...
Step 16/16 : CMD NODE_ENV=production node build/bundle.js
---> Running in 814f004cff51
Removing intermediate container 814f004cff51
---> 1ee48ef280b4
Successfully built 1ee48ef280b4
Successfully tagged wp-calypso:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
**docker run -it --name wp-calypso --rm -p 80:3000 wp-calypso** ERROR:
docker: Error response from daemon: driver failed programming external connectivity on endpoint wp-calypso (d3fb5bfb569d79d341222aec34208b4a4b908f8cf4a4a12a7515a5bc062d133c): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:80:tcp:172.17.0.2:3000: input/output error.
By any chance might there already be a service on your machine bound to port 3000? If you use -p 3001:3000 instead of -p 80:3000 (or some other random port) will it start?
I edited your comment @dmsnell because you had the ports backwards :p It's likely IIS Express running on port 80 in Windows. It's terribly annoying.
Hi @enesyteam
Are you still facing issues?
Sorry for replying late, but still can not fix my problem.
What is the output of docker run -it --name wp-calypso --rm -p 3000:3000 wp-calypso?
The output when run docker run -it --name wp-calypso --rm -p 3000:3000 wp-calypso:
> docker run -it --name wp-calypso --rm -p 3000:3000 wp-calypso
docker: Error response from daemon: driver failed programming external connectivity on endpoint wp-calypso (988027370a28b6c59d5e37988fbbcbe833f1590285ce8718bb4ce63ea5491816): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:3000:tcp:172.17.0.2:3000: input/output error.
@enesyteam I've seen this issue with Docker before on a specific Linux installation. I wonder if there's an issue with the port mapping because of that message. Would you be willing to see if you can get another Docker server running on port 3000? Alternatively, would you mind trying to run the same command on a different port than 3000?
trying to run the same command on a different port than 3000 throw the same error.
On:
Windows machine, installed Docker Community edition, Version 18.06.1-ce-win73 (19507)
thanks @enesyteam - I'm still curious more about whether or not Docker is able to map any port to 3000. Can you try this one, for example?
In one window run this
docker run --rm -it -p 3000:8000 crccheck/hello-world
Once it starts up, in another window run this to see if it responds.
curl localhost:3000
Also, make sure your firewall is off (not recommended) or Docker is allowed to open ports (recommended).
Thanks you! I report some errors when following your commands above:
> docker run --rm -it -p 3000:8000 crccheck/hello-world
docker: Error response from daemon: driver failed programming external connectivity on endpoint practical_hugle (c8569341edcea8823dfe91edb17a83a267a42b612cba5d8528c5337ce6905746): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:3000:tcp:172.17.0.2:8000: input/output error.
And I don't known how to enable to let Docker is allowed to open ports.
And I don't known how to enable to let Docker is allowed to open ports.
Google this, as it鈥檚 specific to the version of windows you鈥檙e running. Also, feel free to file a bug on Docker鈥檚 repository if you need some help.
@enesyteam I'm going to close this for now. hopefully you can get Docker working and remove the conflict with a running server on your machine.
basically if you can run the command4 I shared and get a working response then Calypso should work as well.
you may start debugging by running curl localhost:3000 without starting Docker and see if you get a response. something may already be listening on that port.
aside from that we're somewhat limited in what we can do. feel free to let us know if you get Docker setup. best wishes!