Dockerfile 280 B

1234567891011121314151617
  1. # syntax=docker/dockerfile:1
  2. FROM golang:1.23 AS build
  3. WORKDIR /src
  4. COPY <<EOF /src/main.go
  5. package main
  6. import "fmt"
  7. func main() {
  8. fmt.Println("hello, world")
  9. }
  10. EOF
  11. RUN go build -o /bin/hello ./main.go
  12. FROM scratch
  13. COPY --from=build /bin/hello /bin/hello
  14. CMD ["/bin/hello"]