mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
Add sample, stack and port to ARM64
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
parent
b04dffdc2f
commit
a7de20c29d
11
contrib/golang/Dockerfile
Normal file
11
contrib/golang/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM debian:stretch
|
||||
|
||||
RUN mkdir -p /usr/local/go
|
||||
ENV PATH=$PATH:/usr/local/go/bin
|
||||
RUN apt update && apt -qy install curl \
|
||||
&& curl -SL https://storage.googleapis.com/golang/go1.9.linux-arm64.tar.gz > go1.9.linux-arm64.tar.gz \
|
||||
&& tar -xvf go1.9.linux-arm64.tar.gz -C /usr/local/go --strip-components=1
|
||||
|
||||
RUN go version
|
||||
|
||||
CMD ["/bin/sh"]
|
28
contrib/prometheus/Dockerfile
Normal file
28
contrib/prometheus/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM arm64v8/alpine:3.5
|
||||
|
||||
workdir /root
|
||||
RUN apk add --update libarchive-tools
|
||||
|
||||
ADD https://github.com/prometheus/prometheus/releases/download/v1.5.2/prometheus-1.5.2.linux-arm64.tar.gz /root/
|
||||
RUN bsdtar -xvf prometheus-*.tar.gz -C ./ --strip-components=1
|
||||
|
||||
RUN mkdir -p /usr/share/prometheus
|
||||
RUN mkdir -p /etc/prometheus
|
||||
|
||||
RUN cp prometheus /bin/prometheus
|
||||
RUN cp promtool /bin/promtool
|
||||
RUN cp prometheus.yml /etc/prometheus/prometheus.yml
|
||||
RUN cp -r console_libraries/ /usr/share/prometheus/console_libraries/
|
||||
RUN cp -r consoles/ /usr/share/prometheus/consoles/
|
||||
|
||||
#RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/
|
||||
|
||||
EXPOSE 9090
|
||||
VOLUME [ "/prometheus" ]
|
||||
WORKDIR /prometheus
|
||||
ENTRYPOINT [ "/bin/prometheus" ]
|
||||
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \
|
||||
"-storage.local.path=/prometheus", \
|
||||
"-web.console.libraries=/usr/share/prometheus/console_libraries", \
|
||||
"-web.console.templates=/usr/share/prometheus/consoles" ]
|
||||
|
40
docker-compose.arm64.yml
Normal file
40
docker-compose.arm64.yml
Normal file
@ -0,0 +1,40 @@
|
||||
version: "3.2"
|
||||
services:
|
||||
gateway:
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||
ports:
|
||||
- 8080:8080
|
||||
image: alexellis2/gateway:0.6.6-beta-arm64
|
||||
networks:
|
||||
- functions
|
||||
environment:
|
||||
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
- 'node.platform.os == linux'
|
||||
prometheus:
|
||||
image: alexellis2/prometheus:1.5.2-arm64
|
||||
command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 --alertmanager.url=http://alertmanager:9093"
|
||||
ports:
|
||||
- 9090:9090
|
||||
depends_on:
|
||||
- gateway
|
||||
- alertmanager
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- 'node.role == manager'
|
||||
- 'node.platform.os == linux'
|
||||
|
||||
networks:
|
||||
functions:
|
||||
driver: overlay
|
||||
# Docker does not support this option yet - maybe create outside of the stack and reference as "external"?
|
||||
#attachable: true
|
30
gateway/Dockerfile.arm64
Normal file
30
gateway/Dockerfile.arm64
Normal file
@ -0,0 +1,30 @@
|
||||
FROM alexellis2/golang:1.9-arm64 as build
|
||||
WORKDIR /go/src/github.com/alexellis/faas/gateway
|
||||
ENV GOPATH=/go
|
||||
|
||||
COPY vendor vendor
|
||||
|
||||
COPY handlers handlers
|
||||
COPY metrics metrics
|
||||
COPY requests requests
|
||||
COPY tests tests
|
||||
|
||||
COPY types types
|
||||
COPY queue queue
|
||||
COPY plugin plugin
|
||||
COPY server.go .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gateway .
|
||||
|
||||
FROM debian:stretch
|
||||
WORKDIR /root/
|
||||
|
||||
EXPOSE 8080
|
||||
ENV http_proxy ""
|
||||
ENV https_proxy ""
|
||||
|
||||
COPY --from=build /go/src/github.com/alexellis/faas/gateway/gateway .
|
||||
|
||||
COPY assets assets
|
||||
|
||||
CMD ["./gateway"]
|
11
sample-functions/AlpineFunction/Dockerfile.arm64
Normal file
11
sample-functions/AlpineFunction/Dockerfile.arm64
Normal file
@ -0,0 +1,11 @@
|
||||
FROM arm64v8/alpine:3.6
|
||||
|
||||
ADD https://github.com/alexellis/faas/releases/download/0.6.5/fwatchdog-arm64 /usr/bin/fwatchdog
|
||||
# COPY ./fwatchdog /usr/bin/
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
# Populate example here
|
||||
# ENV fprocess="wc -l"
|
||||
|
||||
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
|
||||
CMD ["fwatchdog"]
|
Loading…
x
Reference in New Issue
Block a user