question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to build docker image

See original GitHub issue

Do you want to request a feature or report a bug?

Bug

What did you do?

docker build -t baget -f .\Dockerfile .

What did you expect to see?

A built docker image.

What did you see instead?

Error.

Output of git rev-parse HEAD: (What version of BaGet are you using?)

c0408d285938a792a299ad36f985b0b2d39f5277

What is your environment & configuration (arguments, platform, …)?

On Windows 10.

> dotnet --version; docker --version
2.2.100-preview3-009430
Docker version 18.06.1-ce, build e68fc7a

If applicable, please paste the log output in DEBUG level

> docker build -t baget -f .\Dockerfile .
Sending build context to Docker daemon  200.8MB
Step 1/15 : FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
2.1-aspnetcore-runtime: Pulling from microsoft/dotnet
f17d81b4b692: Pull complete
2ee72f4b897f: Pull complete
648bf96b76d4: Pull complete
289d0670f0e6: Pull complete
Digest: sha256:0c5bf1f5c8a94ba41eeed55f4464235a5316e6b8b8a4a1615b817d71a8bb77c6
Status: Downloaded newer image for microsoft/dotnet:2.1-aspnetcore-runtime
 ---> 2e7faa3745d9
Step 2/15 : WORKDIR /app
 ---> Running in 04a8ed32b3b2
Removing intermediate container 04a8ed32b3b2
 ---> 68f8eccd0afc
Step 3/15 : EXPOSE 80
 ---> Running in 964d674a6c5f
Removing intermediate container 964d674a6c5f
 ---> 21c66d622cc7
Step 4/15 : FROM microsoft/dotnet:2.1-sdk AS build
2.1-sdk: Pulling from microsoft/dotnet
bc9ab73e5b14: Already exists
193a6306c92a: Already exists
e5c3f8c317dc: Already exists
a587a86c9dcb: Already exists
05d12e362f13: Pull complete
0f0ff2f82a4f: Pull complete
733da37b69d8: Pull complete
Digest: sha256:0c55c7706078b753760653243ce42909ae8b45a68d13ad84a6e0b8cd415d8db1
Status: Downloaded newer image for microsoft/dotnet:2.1-sdk
 ---> 732ac6c02e83
Step 5/15 : WORKDIR /src
 ---> Running in b77f58cc7494
Removing intermediate container b77f58cc7494
 ---> 643386ff8c7d
Step 6/15 : ENV IS_DOCKER true
 ---> Running in dcfa1efd18a9
Removing intermediate container dcfa1efd18a9
 ---> 8861cd0da336
Step 7/15 : COPY . .
 ---> 4c40160a6617
Step 8/15 : RUN dotnet restore src/BaGet
 ---> Running in 6929b35beab4
  Restoring packages for /src/src/BaGet.Azure/BaGet.Azure.csproj...
  Restoring packages for /src/src/BaGet.Core/BaGet.Core.csproj...
  Installing System.Numerics.Vectors 4.4.0.
  Installing System.Buffers 4.4.0.
  Installing NuGet.Common 4.7.0.
  Installing NuGet.Versioning 4.7.0.
  Installing Microsoft.Spatial 7.2.0.
  Installing Microsoft.Azure.Search.Common 5.0.1.
  Installing NuGet.Packaging.Core 4.7.0.
  Installing NuGet.Versioning 4.8.0.
  Installing Microsoft.Build.Tasks.Git 1.0.0-beta-63127-02.
  Installing Microsoft.SourceLink.Common 1.0.0-beta-63127-02.
  Installing Newtonsoft.Json 6.0.8.
  Installing Microsoft.Azure.Search.Service 5.0.1.
  Installing Microsoft.Azure.Search.Data 5.0.1.
  Installing Microsoft.Rest.ClientRuntime 2.3.11.
  Installing Microsoft.Rest.ClientRuntime.Azure 3.3.12.
  Installing NuGet.Packaging 4.7.0.
  Installing Microsoft.SourceLink.GitHub 1.0.0-beta-63127-02.
  Installing WindowsAzure.Storage 9.3.0.
  Installing Microsoft.Azure.KeyVault.Core 1.0.0.
  Installing Newtonsoft.Json 10.0.2.
  Installing Microsoft.Azure.Search 5.0.1.
  Generating MSBuild file /src/src/BaGet.Azure/obj/BaGet.Azure.csproj.nuget.g.props.
  Generating MSBuild file /src/src/BaGet.Core/obj/BaGet.Core.csproj.nuget.g.props.
  Generating MSBuild file /src/src/BaGet.Core/obj/BaGet.Core.csproj.nuget.g.targets.
  Generating MSBuild file /src/src/BaGet.Azure/obj/BaGet.Azure.csproj.nuget.g.targets.
  Restore completed in 3.55 sec for /src/src/BaGet.Core/BaGet.Core.csproj.
  Restore completed in 3.55 sec for /src/src/BaGet.Azure/BaGet.Azure.csproj.
  Restoring packages for /src/src/BaGet.Protocol/BaGet.Protocol.csproj...
  Generating MSBuild file /src/src/BaGet.Protocol/obj/BaGet.Protocol.csproj.nuget.g.props.
  Generating MSBuild file /src/src/BaGet.Protocol/obj/BaGet.Protocol.csproj.nuget.g.targets.
  Restore completed in 7.02 ms for /src/src/BaGet.Protocol/BaGet.Protocol.csproj.
  Restoring packages for /src/src/BaGet/BaGet.csproj...
  Installing System.Threading.ThreadPool 4.0.10.
  Installing Microsoft.Win32.Registry 4.0.0.
  Installing NuGet.Packaging.Core.Types 4.2.0.
  Installing System.Diagnostics.Process 4.1.0.
  Installing System.Threading.Thread 4.0.0.
  Installing NuGet.Frameworks 4.2.0.
  Installing NuGet.Packaging.Core 4.2.0.
  Installing NuGet.Common 4.2.0.
  Installing NuGet.RuntimeModel 4.2.0.
  Installing NuGet.Packaging 4.2.0.
  Installing NuGet.ContentModel 4.2.0.
  Installing NuGet.Repositories 4.2.0.
  Installing NuGet.Versioning 4.2.0.
  Installing System.ComponentModel.Annotations 4.4.1.
  Installing Microsoft.AspNetCore.Razor.Design 2.1.1.
  Installing NuGet.Client 4.2.0.
  Installing McMaster.Extensions.CommandLineUtils 2.2.5.
  Generating MSBuild file /src/src/BaGet/obj/BaGet.csproj.nuget.g.props.
  Generating MSBuild file /src/src/BaGet/obj/BaGet.csproj.nuget.g.targets.
  Restore completed in 2.69 sec for /src/src/BaGet/BaGet.csproj.
Removing intermediate container 6929b35beab4
 ---> bc2f38f6be03
Step 9/15 : RUN dotnet build src/BaGet -c Release -o /app
 ---> Running in 90a50b935419
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 45.94 ms for /src/src/BaGet.Azure/BaGet.Azure.csproj.
  Restore completed in 45.94 ms for /src/src/BaGet.Core/BaGet.Core.csproj.
  Restore completed in 0.33 ms for /src/src/BaGet.Protocol/BaGet.Protocol.csproj.
  Restore completed in 7.54 ms for /src/src/BaGet/BaGet.csproj.
  BaGet.Protocol -> /app/BaGet.Protocol.dll
  BaGet.Core -> /app/BaGet.Core.dll
  BaGet.Azure -> /app/BaGet.Azure.dll
  BaGet -> /app/BaGet.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.10
Removing intermediate container 90a50b935419
 ---> 7e1fc0476d59
Step 10/15 : FROM build AS publish
 ---> 7e1fc0476d59
Step 11/15 : RUN dotnet publish src/BaGet -c Release -o /app
 ---> Running in 8317198f4ee7
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 34.41 ms for /src/src/BaGet.Azure/BaGet.Azure.csproj.
  Restore completed in 30.76 ms for /src/src/BaGet.Core/BaGet.Core.csproj.
  Restore completed in 0.51 ms for /src/src/BaGet.Protocol/BaGet.Protocol.csproj.
  Restore completed in 18.7 ms for /src/src/BaGet/BaGet.csproj.
  BaGet.Protocol -> /src/src/BaGet.Protocol/bin/Release/netstandard2.0/BaGet.Protocol.dll
  BaGet.Core -> /src/src/BaGet.Core/bin/Release/netstandard2.0/BaGet.Core.dll
  BaGet.Azure -> /src/src/BaGet.Azure/bin/Release/netstandard2.0/BaGet.Azure.dll
  BaGet -> /src/src/BaGet/bin/Release/netcoreapp2.1/BaGet.dll
/src/src/BaGet/BaGet.csproj(39,5): error MSB6003: The specified task executable "sh" could not be run. The working directory "../Baget.UI/" does not exist.
The command '/bin/sh -c dotnet publish src/BaGet -c Release -o /app' returned a non-zero code: 1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
phazacommented, Nov 16, 2018

The first error is because BaGet.UI is spelled wrong in BaGet.csproj. *nix is usually case sensitive.
The next error will probably be that npm is not found

0reactions
loic-sharmacommented, Nov 17, 2018

Thank you all for the help! This should be fixed by: https://github.com/loic-sharma/BaGet/pull/132

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to build my docker image
I have a created a project as well as dockerfiles inside it. I'm trying to run it from docker but I keep getting...
Read more >
apache - Docker : image build failed
1 Answer 1 ... Paths in a Dockerfile are always relative to the the context directory. The context directory is the positional argument...
Read more >
How to debug a failed docker build command?
If the build command is failing because of a problem with the container, you can try running the container interactively using the docker ......
Read more >
Failed to build docker image with the Dockerfile · Issue #5499
Tried to build a docker image with the command : docker image build -t aws-cdk:1.0 . But failed with the following error.
Read more >
How to solve the error 'Failed to build the docker image ...
This error message typically indicates that there was an issue building the Docker image for your project. To troubleshoot the problem, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found