12. Functions Creation Steps - CloudDarsh/OracleCloud GitHub Wiki




Step4: Check the context (*) denotes which region context is pointing. Validate If it matches your current region
$ fn list context
Switch to right context $ fn use context eu-frankfurt-1

$ fn update context oracle.compartment-id ocid1.compartment.oc1..aaaaaaaape26buh5zkbujozgyrlecuplate5qvmllg3ym3ajotrz4q2q6yzq

Step6: Provide a unique repository name prefix to distinguish your function images from other people’s. For example, with 'jdoe' as the prefix, the image path for a 'hello' function image is '.ocir.io//jdoe/hello:0.0.1'
$ fn update context registry fra.ocir.io/ctspaas072018/[repo-name-prefix]

This step can be taken from Auth token document
It configures the fn project context with the ocid of the compartment for repository to and from which our oracle function will push and pull the images.
$ fn update context oracle.image-compartment-id <ocid_of_cpompartment_id>

If you don’t give this details it will try to push into root compartment
$ docker login -u ‘xxxx/[email protected]' fra.ocir.io Password: [PASS THE AUTH TOKEN GENERATED IN STEP7]

$ fn init --runtime java hello-java

List the application, It display’s the application created in OCI.
$ fn list apps NAME ID Helloworld-app ocid1.fnapp.oc1.eu-frankfurt-1.XXXXXXXXXXXXX
Let’s Deploy the function.
$ fn -v deploy --app Helloworld-app



$ fn invoke Helloworld-app hello-java Hello, world!
$ echo -n 'xyz' | fn invoke Helloworld-app hello-java Hello, xzy!
