Skip to content

Commit 6f0519e

Browse files
alexellisjohnmccabe
authored andcommitted
Updates to instructions
1 parent fad98bb commit 6f0519e

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

README.md

+22-10
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,35 @@ It demonstrates the use of a multi-stage build (available in Docker CE 17.06+) t
1818

1919
## Deploying the Function
2020

21-
### Using the CLI (`faas-cli`)
22-
Install the client as described at the [faas-cli repo](https://github.com/alexellis/faas-cli/), then deploy the function as follows:
21+
Make sure you have deployed a FaaS stack to your cluster using the instructions on the [FaaS repo](https://github.com/alexellis/faas).
22+
23+
### Use the CLI (`faas-cli`)
24+
25+
**Get the CLI**
26+
27+
The [faas-cli](https://github.com/alexellis/faas-cli/) can be installed via `brew install faas-cli` or `curl -sSL https://get.openfaas.com | sudo sh`.
28+
29+
Now deploy the function as follows:
2330

2431
```
2532
# faas-cli -action deploy -image=johnmccabe/faas-img2ansi -name=img2ansi -fprocess="/usr/bin/faas-img2ansi"
2633
200 OK
2734
URL: http://localhost:8080/function/img2ansi
2835
```
2936

37+
### Testing the Function
38+
Now that the function is running in your FaaS environment you can test it from the command line by running:
39+
40+
```
41+
$ curl -SL https://raw.githubusercontent.com/johnmccabe/faas-img2ansi/master/images/gopher.png > gopher.png
42+
43+
$ curl localhost:8080/function/img2ansi --data-binary @gopher.png
44+
```
45+
46+
**NOTE**: as mentioned earlier, you should stick to small images for the moment (32x32 or so) as the function does not currently scale down large images.
47+
48+
## Other ways to deploy the function
49+
3050
### Using Curl
3151
The function can be deployed using curl to hit the API endpoint directly:
3252
```
@@ -43,11 +63,3 @@ The function can be deployed using curl to hit the API endpoint directly:
4363
You can also create the function via the UI at http://localhost:8080/ui/, clicking the `Create New Function` link and entering the following data:
4464

4565
![](images/create_new_function.png)
46-
47-
## Testing the Function
48-
Now that the function is running in your FaaS environment you can test it from the command line by running:
49-
```
50-
curl localhost:8080/function/img2ansi --data-binary @images/gopher.png
51-
```
52-
53-
**NOTE**: as mentioned earlier, you should stick to small images for the moment (32x32 or so) as the function does not currently scale down large images.

0 commit comments

Comments
 (0)