Skip to content

Commit

Permalink
chore(docker): build with golang 1.17, alpine 3.15
Browse files Browse the repository at this point in the history
  • Loading branch information
guessi committed Mar 19, 2022
1 parent 4be9a84 commit 73aa53a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.17
- name: Run unit tests
run: |
go test -mod vendor ./... -cover
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.17
- name: Run unit tests
run: |
go test -mod vendor ./... -cover
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
FROM golang:1.17.3-alpine3.14 as builder
FROM golang:1.17-alpine3.15 as builder

WORKDIR /go/src/github.com/rajatjindal/krew-release-bot
COPY . .

RUN apk add --no-cache git

RUN CGO_ENABLED=0 GOOS=linux go test -mod vendor ./... -cover
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor --ldflags "-s -w" -o krew-release-bot cmd/action/*

FROM alpine:3.14.3
FROM alpine:3.15

RUN mkdir -p /home/app
WORKDIR /home/app

# Add non root user
RUN addgroup -S app && adduser app -S -G app
RUN chown app /home/app

WORKDIR /home/app

USER app

COPY --from=builder /go/src/github.com/rajatjindal/krew-release-bot/krew-release-bot /usr/local/bin/
Expand Down

0 comments on commit 73aa53a

Please sign in to comment.