-
Notifications
You must be signed in to change notification settings - Fork 544
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
build.sh not found when doing docker build #30
Comments
I have the exact same issue . Running Docker Desktop for Windows 2.2. |
Try this:
|
even doing so still getting this: Step 9/14 : ENV VERSION=test |
Sorry I haven't gotten to this! I'll try to fix it this weekend. |
yes me too it looks like its not copying the build directory when you ls the working directory or something |
I'm also running into this.
|
Update: If I download this repo as a zip, then I'm able to build the image, after setting I think the chapter is assuming the necessary directories (e.g. |
Hey all -- i'm having a hard time reproducing this! Some quick questions to help narrow this down:
As for me, I'm doing a Or is it that the instructions in the book don't make it clear that you need the whole repo? (If so I'm sorry about that!) |
I created a quick video for how it works for me. Hopefully this'll be helpful for folks: |
First of all thanks for your hard work and great video... Secondly - unfortunately after following your steps I got the same result as you can see... I have the same version of the Docker.. I ignored the instruction of cloning to the folder our of the Go path because as far as I know I do not have GO installed on this PC at all.. I run Win 10 Pro and I have cloned to C:\Code\kuard and I also pruned the docker prior to the build... hm... any ideas? I tried few times before - started with just book instructions and then switched to this Git repo and cloning... |
PS now I am pretty new to docker and I have absolutely no experience with GO... now I am not sure - perhaps PC must have GO installed after all in order to build this image? Or when it downloads alpine - go image it is building other stuff already from the container and I no need GO or even Node to be installed locally? |
@arkfen Docker for Windows -> Settings -> Shared Drivers -> Enabled for C: |
Hey all -- clearly this is an issue that only happens on Windows. I'm traveling this week and don't have easy access to a windows machine (should probably set up a VM). I'll try and dig in this weekened. |
I am experiencing the same issue; I am running Docker on a Windows 10 machine. Please let us know your findings when you try it out on Windows 10. |
I had the same issue on macOS Catalina, version 10.15.3. Docker version 19.03.5, build 633a0ea. Just posting it here in case anyone comes with same issue from the book. I was running the script directly from the book, without cloning the Git repo. Then, I cloned the repo, as per directions from @jbeda and just ran the Dockerfile there and it worked like a charm. Hopefully, this helps someone. |
I am also facing this issue on Centos 7. Solved:
|
I am experiencing the same issue; I am running Docker on a Windows 10 Pro machine. |
There are windows line endings in the repo. It is not working for windows because of the shebang in build/build.sh If you remove the ^M from all lines in the *.sh files it works fine on windows. The link below talks about how to fix this for the repo. |
arkfen, |
@os-learner can you change all CRLFs to LFs in the *.sh files and re-run? I created a pull request with this done. I am relatively certain this is the issue most people are seeing on Windows devices where git-for-windows is handling line endings for the repo based on user settings. |
@djfrmd , |
You can also do this in VS Code: https://stackoverflow.com/questions/39525417/visual-studio-code-how-to-show-line-endings |
I ran in to this same situation.
In my case this was indeed the problem. If the book told me to download the repository and run docker inside of it, I missed this part. I guess the download may be obvious to folks with docker experience, but I'm new to it. Thanks and have a great day! |
@jbeda Please integrate the line-endings fix #31. This saves a lot of headaches for Windows 10 users. This fix prevents git from converting line-endings on checkout. For everyone else: if you get All you need to do to resolve this, is to convert |
I had the same issue so I clone the repository and you will notice that there is already a Dockerfile with multistage similar to the one you allegedly have created just before. You can delete yours or just replace it by the current Dockerfile. When inside the folder kuard you can simply run the command that is on the book: Hope it helps. |
oh yeah! thanks a lot! it worked just after changing line ending in the notepad++ - took me 20 seconds )) I just did not check the issue for few months and finally found time to do it... and fix it. I hope everyone else got the issue solved... I am not pro regarding line endings for different OSs but if there is a way to leave it the way which works everywhere - it would be nice.. then it would work on Windows right away |
I downloaded kuard-master from GitHub, copied the multi-stage Dockerfile to a new directory on my Windows 10 laptop, then tried running the Docker build, which still failed on the build.sh step. As an alternative, I changed into the kuard-master (unzipped) directory and did a Docker build on the original (cloned/downloaded) multi-stage Dockerfile there and it worked! I also tried doing a search+replace on the CRLF chars on copied/pasted code from an ebook, but that didn't work ultimately either. |
I had the same error on Mac OS Big Sur. I cloned the repo in the ~/go/src/ path (e.g. "git clone https://github.com/kubernetes-up-and-running/kuard.git") and ran docker build from the kuard directory it found the shell script and executed correctly. |
If you're running on Windows, ensure you're not converting the line endings to Windows. Easiest way to do this, which avoids all the post processing mentioned above is to configure it when you clone the repo, e.g. git clone https://github.com/kubernetes-up-and-running/kuard.git --config core.autocrlf=input See here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration (Search for autocrlf) |
I can confirm that this works. I can now run the |
Yes, just append this line:
after the WORKDIR line
|
Hi,
I followed the procedures of multi-stage image build described in chapter 2 but was getting the build.sh not found problem.
$ docker build -t kuard .
.......
Step 11/12 : RUN build/build.sh
---> Running in 1119265327a0
/bin/sh: build/build.sh: not found
Did I miss anything or should I modify something rather than copy paste the content of the Dockerfile? Do I need to clone the the ./kuard to /go/src/github.com/kubernetes-up-and-running/kuard onto my Mac local filesystem? / is read-only on macOS Catalina BTW.
Thanks!
The text was updated successfully, but these errors were encountered: