April 2018
Intermediate to advanced
250 pages
5h 42m
English
The predefined templates may be good enough for strings and developing simple functions, but when things get complex, it is great to know how to tweak OpenFaaS templates by ourselves.
In this section, the Go template will be tweaked to simply reduce the number of build steps as an example. The following Dockerfile of the Go template can be found at template/go/Dockerfile. This Dockerfile already uses the multi-stage build technique:
#################### State 0###################FROM golang:1.8.3-alpine3.6# ... lines removed for brevity#################### State 1###################FROM alpine:3.6RUN apk --no-cache add ca-certificates# Add non root userRUN addgroup -S app adduser -S -g app app \ mkdir -p /home/app \ chown app /home/app ...
Read now
Unlock full access