From 2db6e97bf669532fda95f7c172bf562bef7fb164 Mon Sep 17 00:00:00 2001 From: "Craig J. Bass" <1889973+craigjbass@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:59:42 +0000 Subject: [PATCH] Hello world dockerfile. --- Dockerfile | 8 ++++++++ cmd/action/main.go | 5 +++++ compiled/.keep | 0 go.mod | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 cmd/action/main.go create mode 100644 compiled/.keep diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a6cc4e4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang AS builder +WORKDIR /go/src/sparkling-dependencies +ADD . ./ +RUN CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o ./compiled github.com/madetech/sparkling-dependencies/cmd/action + +FROM scratch +COPY --from=builder /go/src/sparkling-dependencies/compiled/action /action +ENTRYPOINT ["/action"] diff --git a/cmd/action/main.go b/cmd/action/main.go new file mode 100644 index 0000000..344d51f --- /dev/null +++ b/cmd/action/main.go @@ -0,0 +1,5 @@ +package main + +func main() { + println("Hello world") +} diff --git a/compiled/.keep b/compiled/.keep new file mode 100644 index 0000000..e69de29 diff --git a/go.mod b/go.mod index ba251a6..4462c5c 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module sparkling-dependencies +module github.com/madetech/sparkling-dependencies go 1.19