Closed IvanFarkas closed 6 years ago
I'm having this exact issue as well, got about 2 minutes into using draft when I hit this :(
What is the workflow for using draft with ASP.NET Core when you have multiple projects?
I think they expect you to package your libraries as a NuGet package and upload them to your private NuGet server. This way the Dockerfile refers only current context or subdirectories.
bingo. The application directory should contain (ha!) everything to containerize your application. If your application relies on external dependencies outside of the docker context, then you'll need to either
a) ship it as a NuGet package as @IvanFarkas mentions, OR
b) run draft create
from the parent directory, so Docker has the necessary context required to build and package your application.
The container should live in a directory where it'll have the context required to build your application entirely from source. If your external dependencies can be packaged, that's even better :)
For an example, have a look at the example-python app, which contains source code (app.py) and compiles external dependencies (requirements.txt).
Fantastic! We figured it out @bacongobbler. I can close this now.
How did you figure it out? I'm having a similar issue where I have a solution with one project referencing the others. I'd like to simply set the docker context in the draft.toml
file don't think that I can.
Draft Up Referencing Source in Parent Directory
The goal is to use
draft up
to deploy this application to a Kubernetes cluster. The challange is that the app is referencing a library from the parent directory. I created the DraftReferencingSourceInParentDir app to demonstrate the issue.draft up
cannot execute in the example-dotnet project directory since thedocker build
will return ano such file or directory
error for the library project.Result
Log
draft logs 01CFAVZ5N7GF78FPD6MRSP197H
Build Docker Container & Run Docker Image
docker build
have to be called from the solution root directory to build a docker image and run it. This is demonstrated below. The app is working on docker following these steps.Open a new console
Result
Question
How do I use
draft up
when the app is referencing a library from the parent directory?