Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Go image #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ensure the same behavior across languages.
* `random` - Each time when the images are build a random image is selected and build.
* `reactphp` - Using [ReactPHP](https://reactphp.org/) (January 2020)
* `nodejs` - Using [NodeJS](https://nodejs.org/en/) (February 2020)
* `go` - Using [Go](https://nodejs.org/en/) (March 2020)

## Configuration

Expand Down
23 changes: 23 additions & 0 deletions images/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.14-alpine3.11 AS build

RUN mkdir /opt/app
WORKDIR /opt/app

COPY app.go /opt/app

# hadolint ignore=DL3018,DL3019
RUN apk add git gcc musl-dev godep

ENV GOBIN /go/bin
ENV GO111MODULE on

WORKDIR /go

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w' -o /app /opt/app/app.go

### App
FROM scratch AS app

COPY --from=build /app /app

ENTRYPOINT ["/app"]
4 changes: 4 additions & 0 deletions images/go/app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package main

func main() {
}
Loading