aspnet / aspnet-docker

[Archived] ASP.NET Core Docker images for 1.x. Go to https://github.com/dotnet/dotnet-docker for 2.1 and up.
https://asp.net
719 stars 171 forks source link

Docker build fails due to 'sha256sum' is not recognized as an internal or external command" #435

Closed Arash-Sabet closed 5 years ago

Arash-Sabet commented 5 years ago

Describe the bug

Docker build fails in an angular asp.net core 2.1 web application.

Steps to reproduce the issue

Create an angular asp.net core 2.1 web app project in VS 2017 and add a Docker file to the project. Make sure that the latest version of docker community is installed on your machine with windows-enabled containers. Include the following code in the docker file:

FROM microsoft/dotnet:2.1-sdk
# set up node
ENV NODE_VERSION 8.9.4
ENV NODE_DOWNLOAD_SHA 21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc
RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \
    && echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
    && tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
    && rm nodejs.tar.gz \
    && ln -s /usr/local/bin/node /usr/local/bin/nodejs

You will get the following error message:

2>------ Build started: Project: AnotherMeshApp, Configuration: Debug Any CPU ------
2>Build started 12/14/2018 7:24:39 AM.
2>Target SFAppBuildApplication:
2>  Target SFAppBuildServiceProject:
2>    docker build -f "C:\Users\myaccount\source\repos\AnotherMeshApp\WebMeshApp\Dockerfile" -t webmeshapp:dev "C:\Users\myaccount\source\repos\AnotherMeshApp"
2>    Sending build context to Docker daemon  333.3MB
2>
2>    Step 1/4 : FROM microsoft/dotnet:2.1-sdk
2>     ---> 22b8b0893d44
2>    Step 2/4 : ENV NODE_VERSION 8.9.4
2>     ---> Running in 12f1d4971067
2>    Removing intermediate container 12f1d4971067
2>     ---> cb7ffdc709a5
2>    Step 3/4 : ENV NODE_DOWNLOAD_SHA 21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc
2>     ---> Running in a35bb969a75f
2>    Removing intermediate container a35bb969a75f
2>     ---> 2645bc715cd7
2>    Step 4/4 : RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz     && echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c -     && tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1     && rm nodejs.tar.gz     && ln -s /usr/local/bin/node /usr/local/bin/nodejs
2>     ---> Running in f0307e933bba
2>      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2>                                     Dload  Upload   Total   Spent    Left  Speed
2>
2>      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2>      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2>    100  7041    0  7041    0     0   7041      0 --:--:-- --:--:-- --:--:--  7911
2>    'sha256sum' is not recognized as an internal or external command,
2>    operable program or batch file.
2>    
2>    C:\Users\myaccount\.nuget\packages\microsoft.visualstudio.azure.sfapp.targets\1.0.0-preview.7.5\build\Microsoft.VisualStudio.Azure.SFApp.Targets.targets(196,5): error : The command 'cmd /S /C curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz     && echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c -     && tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1     && rm nodejs.tar.gz     && ln -s /usr/local/bin/node /usr/local/bin/nodejs' returned a non-zero code: 255
2>    C:\Users\myaccount\.nuget\packages\microsoft.visualstudio.azure.sfapp.targets\1.0.0-preview.7.5\build\Microsoft.VisualStudio.Azure.SFApp.Targets.targets(196,5): error SFA1003: Building dockerfile 'C:\Users\myaccount\source\repos\AnotherMeshApp\WebMeshApp\Dockerfile' failed.
2>  Done building target "SFAppBuildServiceProject" in project "WebMeshApp.csproj" -- FAILED.
2>
2>  Done building project "WebMeshApp.csproj" -- FAILED.
2>
2>Build FAILED.
2>
2>C:\Users\myaccount\.nuget\packages\microsoft.visualstudio.azure.sfapp.targets\1.0.0-preview.7.5\build\Microsoft.VisualStudio.Azure.SFApp.Targets.targets(196,5): error : The command 'cmd /S /C curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz     && echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c -     && tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1     && rm nodejs.tar.gz     && ln -s /usr/local/bin/node /usr/local/bin/nodejs' returned a non-zero code: 255
2>C:\Users\myaccount\.nuget\packages\microsoft.visualstudio.azure.sfapp.targets\1.0.0-preview.7.5\build\Microsoft.VisualStudio.Azure.SFApp.Targets.targets(196,5): error SFA1003: Building dockerfile 'C:\Users\myaccount\source\repos\AnotherMeshApp\WebMeshApp\Dockerfile' failed.
2>    0 Warning(s)
2>    2 Error(s)
2>
2>Time Elapsed 00:01:40.59
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  1. Using ASP.NET Core version 2.1
  2. With a Dockerfile that looks like above.
  3. With these docker arguments defaulted by VS 2017 environment.

Expected behavior

The build should not fail.

Additional information

N/A

MichaelSimons commented 5 years ago

Moved to https://github.com/dotnet/dotnet-docker/issues/862.