mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Rollback dockerfile (image too big) and add docker run command to docs. (#488)
This commit is contained in:
committed by
Reed Allman
parent
fde2173087
commit
6c21103057
26
Dockerfile
26
Dockerfile
@@ -1,24 +1,12 @@
|
||||
FROM fnproject/dind
|
||||
RUN apk add --no-cache ca-certificates build-base go git bzr mercurial gcc
|
||||
|
||||
ENV GOPATH=/go
|
||||
RUN env
|
||||
ENV PATH=$PATH:/go/bin
|
||||
RUN env
|
||||
# build stage
|
||||
FROM golang:alpine AS build-env
|
||||
RUN apk --no-cache add build-base git bzr mercurial gcc
|
||||
ENV D=/go/src/github.com/fnproject/fn
|
||||
|
||||
ADD . $D
|
||||
RUN cd $D && go build -o /app/functions
|
||||
RUN cd $D && go build -o fn-alpine && cp fn-alpine /tmp/
|
||||
|
||||
# final stage
|
||||
FROM fnproject/dind
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /tmp/fn-alpine /app/functions
|
||||
CMD ["./functions"]
|
||||
|
||||
# For building extensions
|
||||
ONBUILD ENV REPOPATH=$GOPATH/src/github.com/x/y
|
||||
ONBUILD ADD . $REPOPATH
|
||||
# note: It might be a good idea to move interfaces and models to a new repo with minimal dependencies, then doing a dep ensure/install might work nice
|
||||
# ONBUILD RUN go get -u github.com/golang/dep/cmd/dep
|
||||
# ONBUILD RUN cd $REPOPATH && dep init && dep ensure
|
||||
# Try doing regular go get:
|
||||
ONBUILD RUN cd $REPOPATH && go get
|
||||
ONBUILD RUN cd $REPOPATH && go build -o /app/functions
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# Fn Runtime Options
|
||||
|
||||
## Default run command for production
|
||||
|
||||
This will run with docker in docker.
|
||||
|
||||
```sh
|
||||
docker run --privileged --rm --name fns -it -v $PWD/data:/app/data -p 80:8080 fnproject/functions
|
||||
```
|
||||
|
||||
See below for starting without docker in docker.
|
||||
|
||||
## Configuration
|
||||
|
||||
When starting Fn, you can pass in the following configuration variables as environment variables. Use `-e VAR_NAME=VALUE` in
|
||||
|
||||
Reference in New Issue
Block a user