Docker: clean build from source fails with tmp/docker-build###/serve: no such file or dir
Brand new Ubuntu install (EC2), latest github source for serve, latest docker etc.:
1 - sudo docker build --file Dockerfile.cpu -t torchserve:latest .
2 - error:
Step 10/23 : ADD serve serve
ADD failed: stat /var/lib/docker/tmp/docker-builder531966407/serve: no such file or directory
any insights? I was in serve/docker when running if that matters (based on readme directions).
I also tested with gpu build just in case, same error:
Step 8/21 : ADD serve serve
ADD failed: stat /var/lib/docker/tmp/docker-builder942203608/serve: no such file or directory
@lessw2020 Can you please follow this https://github.com/pytorch/serve#quick-start-with-docker and let us know if you are still facing this issue. FYI - We are fixing few docker doc issues as part of #266
Hi @dhaniram-kshirsagar - thanks for the fast response.
Can you please follow this https://github.com/pytorch/serve#quick-start-with-docker
I did exactly the steps from the quick start link which is how I found this issue :) So yes it reproes with the quick start guide steps.
It's a brand new staging server (EC2) for us so I wanted to prove everything working before adding our own models/customizations and hit this issue.
Thanks for the update re: #266 - can you please ping if you need me to test anything re: fixes or workarounds for this issue, and I can do it pretty quickly to try and help resolve.
Thanks much! Less
Hi @dhaniram-kshirsagar - an update, I am able to build with the shell script. I thought your link was to the docker folder readme which was the steps I followed. However double checked your link and saw the home page has different docker directions and recommends using a shell script..I am able to build with the script!
Thus: using the script on the homepage for docker instructions: ./build_image.sh
it works!
Step 10/23 : ADD serve serve ---> 1ea4a35342c0
However, using the steps listed on the /docker readme is where it fails for my server: 'For creating CPU based image :
docker build --file Dockerfile.cpu -t torchserve:latest . '
https://github.com/pytorch/serve/tree/master/docker
I'd prefer to be able to issue the build command directly since I have no info on what's in the script (yes I'll read it tomorrow) but not sure if I'm building an entire image of the build tree vs a lightweight model + server image? Anyway, happy I'm not blocked and hope this helps isolate this issue since it does work as expected with the shell script.
Hi @dhaniram-kshirsagar - we posted at same time :) I followed the directions on the /docker readme - why would that not be valid info and process...if the recommended method is to use the script, then that should be what is on the docker page as well. Anyway, if the script is the preferred way then I will use that but the readme on the /docker page should be adjusted as well to match is the bug here and remove the suggested commands there in favor of the script?
I'll use the script and thanks for confirming that is the recommended process here. Thanks again!
for reference - https://github.com/pytorch/serve/tree/master/docker

@lessw2020 : Looks like you missed out on the first step while following docker readme, where you need to clone the serve repo inside docker directory as well. The script takes care of this step.
@lessw2020 As I have mentioned, we are working on it to fix docker doc via #266.
If you don't want to build it from source then replace the following steps in Dockerfile.cpu/gpu:
ADD serve serve
RUN pip install ../serve/
with
RUN pip install --no-cache-dir torchserve torch-model-archiver
your command
docker build --file Dockerfile.cpu -t torchserve:latest .
And if you still want to build from source and want to use 'docker build' command then
cd serve/docker
git clone https://github.com/pytorch/serve.git
git checkout <master/any branch>
docker build --file Dockerfile.cpu -t torchserve:latest .
[you have already mentioned this :) ]
Hi @dhaniram-kshirsagar and @harshbafna - thanks very much for your help! and now I understand how in the world I have a second copy of /serve repo within my first /serve repo.
Anyway thanks again for the assist and look forward to further improvements...Serve is a huge improvement for deployment. 🥇
Closing as docs were correct however steps in order were not followed.