Closed AndruMace closed 3 years ago
Does bin/pip3-install
exist in your cloned directory?
It exists in that spot in the repo: https://github.com/nickjj/docker-flask-example/blob/main/bin/pip3-install
Also did you change anything in the Dockerfile?
Wow thanks for responding so quickly!
pip3-install does exist in the correct location bin/pip3-install
and no I've made no changes to the Dockerfile.
Edit: I'm on Windows 10 if that additional information helps.
Are you using WSL 2 or PowerShell?
I've tried it both with Powershell and Git-Bash (link below). I'm getting the same error in both.
Would it be possible to try WSL / WSL 2?
Apologies for the delay, I had to get WSL2 set up on my machine and integrated with docker. Looks like WSL2 via Ubuntu 20.04 LTS did the trick! Strange that neither powershell nor gitbash (which has always served me well in the past) didn't work though. Any ideas how I could get it working with either of those?
Technically it should work with PowerShell. I'll look into it.
Thanks! Best of luck.
I was able to get it to build with PowerShell here without making any changes.
I did very similar steps as you. Instead of cloning it from github I copied the files from my WSL 2 instance to C:\Users\Nick\docker-flask-example
then ran a docker-compose build
which worked.
If I were to guess there's some permission issue with the shell scripts in the bin/
directory.
However when I ran it, it fails with permission errors due to Windows not knowing how to deal with Linux file permissions. My Dockerfile is configured to run as a non-root user, but Windows doesn't know how to match the user id / group id of a Linux machine to make the volumes work. This is a limitation of Docker and Windows unfortunately.
I would stick with WSL 2 if you can. It will be a lot faster in the end in terms of file performance if you keep the files inside of WSL 2's file system. Sorry for the bad news but there's no way to reasonably support PowerShell as far as I know. You're more than welcome to dive into the gory details on how Docker handles cross-OS file permissions, but that's a battle I don't want to fight. If you can get it working a PR would be much appreciated and I'd happily merge it in.
Gotcha, thanks for the information. I appreciate your time. I'll probably be sticking with WSL2 for the foreseeable future now that I have it installed, honestly I had been putting it off for far too long anyway haha. Have a nice day, thanks again.
No problem.
Here's a couple of blog posts / videos that may help with keeping your WSL 2 disk space in check btw. There's still some sharp edges around WSL 2 and how it frees up resources:
My steps:
Any idea how to resolve this?