mirror of
https://github.com/openfaas/faas.git
synced 2025-06-15 11:46:46 +00:00
Windows port - spike (#66)
* Add Windows Dockerfile.win * Create appveyor.yml * Create build.ps1 * Port Golang example to Windows
This commit is contained in:
parent
abba90e674
commit
1eaf13c6c8
12
appveyor.yml
Normal file
12
appveyor.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
version: 1.0.{build}
|
||||||
|
image: Visual Studio 2017
|
||||||
|
|
||||||
|
install:
|
||||||
|
- docker version
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- ps: .\watchdog\build.ps1
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
- path: watchdog\watchdog.exe
|
||||||
|
name: watchdog
|
16
sample-functions/BaseFunctions/golang/Dockerfile.win
Normal file
16
sample-functions/BaseFunctions/golang/Dockerfile.win
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM golang:1.7.5-windowsservercore
|
||||||
|
MAINTAINER alexellis2@gmail.com
|
||||||
|
ENTRYPOINT []
|
||||||
|
|
||||||
|
WORKDIR /go/src/github.com/alexellis/faas/sample-functions/golang
|
||||||
|
COPY . /go/src/github.com/alexellis/faas/sample-functions/golang
|
||||||
|
RUN go build
|
||||||
|
|
||||||
|
ADD ./watchdog.exe /
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
ENV fprocess="app.exe"
|
||||||
|
|
||||||
|
ENV suppress_lock="true"
|
||||||
|
|
||||||
|
CMD ["watchdog.exe"]
|
14
watchdog/Dockerfile.win
Normal file
14
watchdog/Dockerfile.win
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM golang:1.7.5-windowsservercore
|
||||||
|
RUN mkdir -p /go/src/github.com/alexellis/faas/watchdog
|
||||||
|
WORKDIR /go/src/github.com/alexellis/faas/watchdog
|
||||||
|
|
||||||
|
COPY main.go .
|
||||||
|
COPY readconfig.go .
|
||||||
|
COPY config_test.go .
|
||||||
|
COPY requesthandler_test.go .
|
||||||
|
COPY types types
|
||||||
|
|
||||||
|
RUN go test
|
||||||
|
env CGO_ENABLED=0
|
||||||
|
env GOOS=windows
|
||||||
|
RUN go build -a -installsuffix cgo -o watchdog.exe .
|
6
watchdog/build.ps1
Normal file
6
watchdog/build.ps1
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
pwd
|
||||||
|
cd watchdog
|
||||||
|
|
||||||
|
docker build -t alexellis2/watchdog:windows . -f .\Dockerfile.win
|
||||||
|
docker create --name watchdog alexellis2/watchdog:windows cmd
|
||||||
|
docker cp watchdog:/go/src/github.com/alexellis/faas/watchdog/watchdog.exe .
|
Loading…
x
Reference in New Issue
Block a user