Created
April 22, 2022 20:19
-
-
Save masonkmeyer/d22f6e1bd192432df06b2b50f0a802ad to your computer and use it in GitHub Desktop.
File server 🤣
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1.4 | |
FROM golang:1.18.1 as builder | |
WORKDIR /src | |
COPY <<EOF main.go | |
package main | |
import ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
log.Fatal(http.ListenAndServe(":8080", http.FileServer(http.Dir("/mount")))) | |
} | |
EOF | |
RUN GO111MODULE=off go build -o app . | |
# Build a runtime container | |
FROM gcr.io/distroless/base-debian10 | |
COPY --from=builder /src / | |
CMD ["/app"] |
Author
masonkmeyer
commented
Apr 22, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment