Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalo-oliveira committed Nov 25, 2021
1 parent 8a601a4 commit 98083ff
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ services.ConfigureFunction() // returns an IFunctionBuilder

If your function has packages from private repositories, you'll need to provide a nuget configuration file to the image build process. On previous versions this could be done with build arguments, but that is considered insecure. Since version 2.x this can only be done with secrets, using BuildKit.

> The OpenFaaS CLI doesn't seem yet to support this, therefore, this can only be done with the Docker CLI.
> The OpenFaaS CLI doesn't seem yet to support this, therefore, this can only be done with the Docker CLI (or BuildKit standalone).
First, you'll need to make sure you are using BuildKit. This can be done with an environment variable.

Expand All @@ -166,8 +166,17 @@ export DOCKER_BUILDKIT=1

You'll need a `NuGet.Config` file. Let's consider we have one at `/home/user/.nuget/NuGet/NuGet.Config`. We just need to pass the file as a secret with the docker build; the name of the secret has to be `nuget.config`.

Since `faas-cli` doesn't yet support this functionality, we have to *shrinkwrap* our function.

```bash
faas-cli build -f hello.yml --shrinkwrap
```

The above prepares our function in the `./build/` folder. Now we can use Docker CLI.

```bash
docker build -t function --secret id=nuget.config,src=/home/goncalo/.nuget/NuGet/NuGet.Config .
cd build/hello
docker build -t hello --secret id=nuget.config,src=/home/user/.nuget/NuGet/NuGet.Config .
```

> Currently, the passwords on the configuration file need to be stored in clear text. If you are on Windows, this won't be the case for the `NuGet.Config` on your computer.
Expand Down

0 comments on commit 98083ff

Please sign in to comment.