Running functions

    • You have a Docker daemon on your local machine. This is already provided if you have used the Quickstart installation.

    Procedure

    The command builds an image for your function if required, and runs this image locally, instead of deploying it on a cluster.

    funckn func

    Run the function locally, by running the command inside the project directory:

    You can force a rebuild of the image by running the command:

    1. func run --build

    It is also possible to disable the build, by running the command:

    1. func run --build=false

    Run the function locally, by running the command inside the project directory:

    You can force a rebuild of the image by running the command:

    1. kn func run --build

    It is also possible to disable the build, by running the command:

      You can verify that your function has been successfully run by using the invoke command and observing the output:

      Expected output

      1. Received response
      2. POST / HTTP/1.1 hello.default.127.0.0.1.sslip.io
      3. User-Agent: Go-http-client/1.1
      4. Content-Length: 25
      5. Accept-Encoding: gzip
      6. K-Proxy-Request: activator
      7. X-Request-Id: 9e351834-0542-4f32-9928-3a5d6aece30c
      8. Forwarded: for=10.244.0.15;proto=http
      9. X-Forwarded-For: 10.244.0.15, 10.244.0.9
      10. X-Forwarded-Proto: http