1

Using docker (compose) in a C# 6.0 API project with class library dependecies throws error, that the dependent library was not found and this article says I should move Docker file to solution level. But I have another API project in the solution (using the same class library) that has own Docker file. So I cannot move the dockerfile to solution level.

What is the solution for this?

1 Answer 1

1

You can change your build context to the directory above your current directory, without moving your Dockerfile.

You need to modify the Dockerfile so paths etc. in it work relative to the parent directory.

Then build the image using the same command you've used until now, but change the context from . to ... If your build command was

docker build -t my-image .

you should now use

docker build -t my-image ..

By moving your build context up a level, you should be able to access the project with the dependent class library and include that in your image.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.