Skip to content

Commit

Permalink
Add Go image
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Sep 29, 2024
1 parent 0e37875 commit d508a9d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
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() {
}

0 comments on commit d508a9d

Please sign in to comment.