File tree 4 files changed +35
-0
lines changed
4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM golang:1.15.1-alpine3.12 AS build-env
2
+
3
+ WORKDIR /tmp/simple-go-app
4
+
5
+ COPY . .
6
+
7
+ RUN CGO_ENABLED=0 GOOS=linux go build
8
+
9
+ FROM scratch
10
+ COPY --from=build-env /tmp/simple-go-app/simple-web-app /app/simple-web-app
11
+
12
+ EXPOSE 8080
13
+ CMD ["/app/simple-web-app" ]
Original file line number Diff line number Diff line change
1
+ A sample GO web application with Dockerfile
2
+
Original file line number Diff line number Diff line change
1
+ module github.com/codefresh-contrib/gitops-certification-examples/simple-web-app
2
+
3
+ go 1.15
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "net/http"
6
+ )
7
+
8
+ func indexHandler (w http.ResponseWriter , r * http.Request ) {
9
+ fmt .Fprintf (w , "I am an application running in Kubernetes. Now at Version 1.0" )
10
+
11
+ }
12
+
13
+ func main () {
14
+ fmt .Println ("Basic web server is starting on port 8080..." )
15
+ http .HandleFunc ("/" , indexHandler )
16
+ http .ListenAndServe (":8080" , nil )
17
+ }
You can’t perform that action at this time.
0 commit comments