2

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?

Mohsen
  • 4,000
  • 8
  • 42
  • 73

1 Answers1

3

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.

white_bear
  • 73
  • 5
  • Setting the parent folder as build context causes the while directory (including my test scripts) to be sent to the Docker daemon. – Mohsen Jan 20 '18 at 05:39
  • So what are the steps to move the `Paket.Restore.targets` to my project folder without damaging the working project? – Mohsen Jan 20 '18 at 05:52
  • [This](https://fsprojects.github.io/Paket/paket-folder.html) link says you should place the `.paket` directory at the root of you project. – Mohsen Jan 20 '18 at 05:57
  • @Mohsen you can use `.dockerignore` to exclude unwanted files/folders – the_joric Aug 09 '18 at 14:01