mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Changed $PWD to work on windows and linux/mac. (#437)
This commit is contained in:
@@ -76,7 +76,7 @@ This guide will get you up and running in a few minutes.
|
||||
To get started quickly with IronFunctions, just fire up an `iron/functions` container:
|
||||
|
||||
```sh
|
||||
docker run --rm -it --name functions --privileged -v $PWD/data:/app/data -p 8080:8080 iron/functions
|
||||
docker run --rm -it --name functions --privileged -v ${pwd}/data:/app/data -p 8080:8080 iron/functions
|
||||
```
|
||||
|
||||
This will start IronFunctions in single server mode, using an embedded database and message queue. You can find all the
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Windows doesn't support Docker in Docker so you'll change the run command to the following:
|
||||
|
||||
```sh
|
||||
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/app/data -p 8080:8080 iron/functions
|
||||
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 iron/functions
|
||||
```
|
||||
|
||||
Then everything should work as normal.
|
||||
|
||||
@@ -35,7 +35,7 @@ ENTRYPOINT ["./funcbin"]
|
||||
Then you simply build your function:
|
||||
|
||||
```sh
|
||||
docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o funcbin
|
||||
docker run --rm -v ${pwd}:/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o funcbin
|
||||
docker build -t $USERNAME/myfunction .
|
||||
```
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This example will show you how to test and deploy a Ruby function to IronFunctio
|
||||
# create your func.yaml file
|
||||
fn init <YOUR_DOCKERHUB_USERNAME>/hello
|
||||
# install dependencies, we need the json gem to run this
|
||||
docker run --rm -v "$PWD":/worker -w /worker iron/ruby:dev bundle install --standalone --clean
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle install --standalone --clean
|
||||
# build the function
|
||||
fn build
|
||||
# test it
|
||||
@@ -24,7 +24,7 @@ Now surf to: http://localhost:8080/r/myapp/hello
|
||||
Create a [Gemfile](http://bundler.io/gemfile.html) file in your function directory, then run:
|
||||
|
||||
```sh
|
||||
docker run --rm -v "$PWD":/worker -w /worker iron/ruby:dev bundle install --standalone --clean
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle install --standalone --clean
|
||||
```
|
||||
|
||||
Ruby doesn't pick up the gems automatically, so you'll have to add this to the top of your `func.rb` file:
|
||||
@@ -38,7 +38,7 @@ Open `func.rb` to see it in action.
|
||||
To update dependencies:
|
||||
|
||||
```sh
|
||||
docker run --rm -v "$PWD":/worker -w /worker iron/ruby:dev bundle update
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle update
|
||||
# then install again to vendor them
|
||||
docker run --rm -v "$PWD":/worker -w /worker iron/ruby:dev bundle update
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle update
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user