joelbirchler
2019-12-06 95be86ecd30e4c88e4b164b7aefcb3755a9d0834
removes flag from books (we will use ENV later)
2 files modified
20 ■■■■■ changed files
books/Dockerfile 8 ●●●●● patch | view | raw | blame | history
books/main.go 12 ●●●● patch | view | raw | blame | history
books/Dockerfile
@@ -1,4 +1,4 @@
# -- build stage --
# -- Build stage --
FROM registry.redhat.io/ubi8/go-toolset:1.12.8 AS builder
@@ -9,14 +9,16 @@
    go build
# -- app stage --
# -- App stage --
FROM registry.redhat.io/ubi8-minimal:8.0-213
LABEL maintainer="jbirchler@redhat.com"
LABEL maintainer="jbirchler@redhat.com" \
      version="v1.0.0"
WORKDIR /home
COPY --from=builder /opt/app-root/src/go/src/books/books /home
USER nobody
EXPOSE 8080
ENTRYPOINT ["./books"]
books/main.go
@@ -1,25 +1,17 @@
package main
import (
    "flag"
    "fmt"
    "time"
    "log"
    "net/http"
    "time"
    "github.com/gorilla/mux"
)
var port string
func init() {
    flag.StringVar(&port, "p", "8080", "Port to listen on")
    flag.StringVar(&port, "port", "8080", "Port to listen on")
}
const port = "8080"
func main() {
    flag.Parse()
    r := mux.NewRouter()
    r.HandleFunc("/", homeHandler)
    r.HandleFunc("/healthz", healthzHandler)