FROM golang:1.23 AS build WORKDIR /src RUN printf '%s\n' \ 'package main' \ 'import ("fmt"; "net/http")' \ 'func main() {' \ ' http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {' \ ' fmt.Fprintln(w, "hello from go")' \ ' })' \ ' http.ListenAndServe(":8080", nil)' \ '}' \ > main.go && go mod init hello && CGO_ENABLED=0 go build -o /out/hello . FROM alpine:3.20 RUN apk add --no-cache socat COPY --from=build /out/hello /hello EXPOSE 8080