Created
July 12, 2020 03:12
-
-
Save russau/7f8dab1fc9a08efcc259ce0fc56aa51c to your computer and use it in GitHub Desktop.
Minimal docker container with a multi-stage build
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
FROM golang:1.14 | |
WORKDIR /go/src/app | |
COPY . . | |
RUN go build hello-world.go | |
FROM scratch | |
COPY --from=0 /go/src/app/hello-world . | |
CMD ["./hello-world"] |
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
package main | |
import "fmt" | |
func main() { | |
fmt.Println("hello world") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment