Copy in the Dockerfile file in ASP.

Source: Internet
Author: User

There is a problem with using Docker to deploy ASP. NET core in Ubuntu today, when the Docker build is always the last hint

Lstat obj/docker/publish:no such file or directory.

And when performing Docker images to view the image, the repository and tag of the generated image are all <none>.

Prompt when performing Docker run

Unable to find image ' crm:latest ' locally

Lenovo to build when the last hint of the obj/docker/publish is supposed to be the problem of this piece. View Dockerfile, which reads as follows

From Microsoft/aspnetcore:2.0/COPY ${source:-obj/docker/  Publish}. entrypoint ["dotnet""crm.dll"]

Because this file vs2017 automatically generated, so usually also did not notice, there is a copy inside, the contents of the same as the error, after checking to know when the dockerfile from the build Docker mirror, You can choose between two commands to add a local directory or file to your image: Add and copy. These two instruction formats are basically the same and basically the same thing

ADD <src>, ... <dest><src> ... <dest>

In both cases, the directory or file (<src>) is copied and added to the container's file system in the specified path (<dest>)

Copy does not support URLs, nor does it specifically treat compressed files. If the build does not specify decompression in the file, then it will not be extracted automatically, only the compressed files will be copied into the container.

Because I build it in the directory containing the Dockerfile file, just change the-obj/docker/publish in the file to-/

Copy in the Dockerfile file in ASP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.