How to use Docker with Paket?

一笑奈何 提交于 2019-12-11 10:31:26

问题


There are several projects in my solution (some production and some test ...) and there is a docker image per each project. Each .fsproj file in the solution contains the line:

<Import Project="..\.paket\Paket.Restore.targets" />

But docker's build context is limited by the project's folder and I'd rather not deal with that problem.

Can use Paket without the need for referring to parent folders?


回答1:


I'm not an expert, but I guess you have two options here:

  1. You can keep Paket.Restore.targets file in each project, which is not so bad IMHO.
  2. In my project I decided to build docker image from parent folder, but yes you can do this by setting build context. If you decide here is a command I use:

    docker build -t "$IMAGE:$TAG_NAME" -f "$DOCKERFILE_PATH" .

I run it from parent level, and by -f you can specify Dockerfile and . at the end sets the context for build.



来源:https://stackoverflow.com/questions/48297951/how-to-use-docker-with-paket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!