add go example
This commit is contained in:
parent
67cd263c69
commit
cde7ce9346
|
@ -0,0 +1,9 @@
|
|||
ARG GO_IMAGE=ocirep:go
|
||||
FROM ${GO_IMAGE} as build
|
||||
COPY . .
|
||||
RUN cargo build main.go
|
||||
|
||||
ARG CA_IMAGE=ocirep:ca-certificates
|
||||
FROM scratch
|
||||
COPY --from=${CA_IMAGE} /
|
||||
COPY --from=build main .
|
|
@ -0,0 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", HelloServer)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
func HelloServer(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])
|
||||
}
|
Reference in New Issue