Skip to content

Commit f948b23

Browse files
committed
Add Go image
1 parent 64897e0 commit f948b23

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
image:
1313
- reactphp # Jan 2020
1414
- nodejs # Feb 2020
15+
- go # Mar 2020
1516
runs-on: ubuntu-latest
1617
steps:
1718
- uses: actions/checkout@v1
@@ -27,6 +28,7 @@ jobs:
2728
- random # Random image every time this workflow is executed
2829
- reactphp # Jan 2020
2930
- nodejs # Feb 2020
31+
- go # Mar 2020
3032
needs:
3133
- lint-dockerfile
3234
runs-on: ubuntu-latest
@@ -48,6 +50,7 @@ jobs:
4850
- random # Random image every time this workflow is executed
4951
- reactphp # Jan 2020
5052
- nodejs # Feb 2020
53+
- go # Mar 2020
5154
needs: build-docker-image
5255
runs-on: ubuntu-latest
5356
steps:
@@ -76,6 +79,7 @@ jobs:
7679
- random # Random image every time this workflow is executed
7780
- reactphp # Jan 2020
7881
- nodejs # Feb 2020
82+
- go # Mar 2020
7983
rules: [customHosts, nonWwwToWww, wwwToNonWww]
8084
runs-on: ubuntu-latest
8185
steps:
@@ -135,6 +139,7 @@ jobs:
135139
- random # Random image every time this workflow is executed
136140
- reactphp # Jan 2020
137141
- nodejs # Feb 2020
142+
- go # Mar 2020
138143
needs: tests
139144
runs-on: ubuntu-latest
140145
steps:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ensure the same behavior across languages.
2424
* `random` - Each time when the images are build a random image is selected and build.
2525
* `reactphp` - Using [ReactPHP](https://reactphp.org/) (January 2020)
2626
* `nodejs` - Using [NodeJS](https://nodejs.org/en/) (February 2020)
27+
* `go` - Using [Go](https://nodejs.org/en/) (March 2020)
2728

2829
## Configuration
2930

images/go/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM golang:1.14-alpine3.11 AS build
2+
3+
RUN mkdir /opt/app
4+
WORKDIR /opt/app
5+
6+
COPY app.go /opt/app
7+
8+
# hadolint ignore=DL3018,DL3019
9+
RUN apk add git gcc musl-dev godep
10+
11+
ENV GOBIN /go/bin
12+
ENV GO111MODULE on
13+
14+
WORKDIR /go
15+
16+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w' -o /app /opt/app/app.go
17+
18+
### App
19+
FROM scratch AS app
20+
21+
COPY --from=build /app /app
22+
23+
ENTRYPOINT ["/app"]

images/go/app.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package main
2+
3+
func main() {
4+
}

0 commit comments

Comments
 (0)