如何在Paket中使用Docker? [英] How to use Docker with Paket?

查看:114
本文介绍了如何在Paket中使用Docker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的解决方案中有几个项目(一些生产和一些测试...)
,每个项目都有一个docker映像。
解决方案中的每个.fsproj文件都包含以下行:

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.

可以使用Paket而不需要引用父文件夹吗?

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

推荐答案

我不是专家,但我想您有这里有两个选项:

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


  1. 您可以在每个文件中保留 Paket.Restore.targets 文件项目,IMHO还不错。

  2. 在我的项目中,我决定从父文件夹构建docker映像,但是可以通过设置构建上下文来实现。如果您确定这是我使用的命令,则使用以下命令:

  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。

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

我从父级运行它,通过 -f 您可以指定Dockerfile和最后设置了构建上下文。

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

这篇关于如何在Paket中使用Docker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆