build with golang:1.18-alpine3.15

This commit is contained in:
guessi 2022-04-18 23:46:44 +08:00
parent cf748ae59d
commit 267f464033
6 changed files with 9 additions and 22 deletions

View File

@ -4,5 +4,6 @@
.git .git
.github .github
.gitignore
vendor/ vendor/
Dockerfile Dockerfile

View File

@ -9,7 +9,7 @@ platform:
steps: steps:
- name: test - name: test
image: golang:1.17-alpine3.15 image: public.ecr.aws/docker/library/golang:1.18-alpine3.15
commands: commands:
- go version - go version
- go fmt ./... - go fmt ./...

View File

@ -1,12 +1,10 @@
FROM golang:1.17-alpine3.15 AS builder FROM public.ecr.aws/docker/library/golang:1.18-alpine3.15 AS builder
LABEL maintainer="guessi <guessi@gmail.com>"
RUN apk add --no-cache git ca-certificates RUN apk add --no-cache git ca-certificates
WORKDIR ${GOPATH}/src/github.com/guessi/ssl-certs-checker WORKDIR ${GOPATH}/src/github.com/guessi/ssl-certs-checker
COPY . . COPY *.go go.mod go.sum ./
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /go/bin/ssl-certs-checker RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /go/bin/ssl-certs-checker
FROM scratch FROM scratch
LABEL maintainer="guessi <guessi@gmail.com>"
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/bin/ssl-certs-checker /opt/ COPY --from=builder /go/bin/ssl-certs-checker /opt/
WORKDIR /opt/ WORKDIR /opt/

View File

@ -33,21 +33,9 @@
+--------------------+----------------+----------------+-------------------------------+-------------------------------+--------------------+------------+ +--------------------+----------------+----------------+-------------------------------+-------------------------------+--------------------+------------+
| Host | Common Name | DNS Names | Not Before | Not After | PublicKeyAlgorithm | Issuer | | Host | Common Name | DNS Names | Not Before | Not After | PublicKeyAlgorithm | Issuer |
+--------------------+----------------+----------------+-------------------------------+-------------------------------+--------------------+------------+ +--------------------+----------------+----------------+-------------------------------+-------------------------------+--------------------+------------+
| www.google.com:443 | www.google.com | www.google.com | 2022-02-28 03:35:56 +0000 UTC | 2022-05-23 03:35:55 +0000 UTC | ECDSA | GTS CA 1C3 | | www.google.com:443 | www.google.com | www.google.com | 2022-03-28 02:26:07 +0000 UTC | 2022-06-20 02:26:06 +0000 UTC | ECDSA | GTS CA 1C3 |
+--------------------+----------------+----------------+-------------------------------+-------------------------------+--------------------+------------+ +--------------------+----------------+----------------+-------------------------------+-------------------------------+--------------------+------------+
## Build from Source
go get -u github.com/guessi/ssl-certs-checker
cd ${GOPATH}/src/github.com/guessi/ssl-certs-checker
vim ... # made some changes
go install github.com/guessi/ssl-certs-checker
ssl-certs-checker --help
# License # License
[MIT LICENSE](LICENSE) [MIT LICENSE](LICENSE)

4
go.mod
View File

@ -1,9 +1,9 @@
module github.com/guessi/ssl-certs-checker module github.com/guessi/ssl-certs-checker
go 1.17 go 1.18
require ( require (
github.com/jedib0t/go-pretty/v6 v6.2.7 github.com/jedib0t/go-pretty/v6 v6.3.0
github.com/urfave/cli/v2 v2.4.0 github.com/urfave/cli/v2 v2.4.0
gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0
) )

4
go.sum
View File

@ -3,8 +3,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKY
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/jedib0t/go-pretty/v6 v6.2.7 h1:4823Lult/tJ0VI1PgW3aSKw59pMWQ6Kzv9b3Bj6MwY0= github.com/jedib0t/go-pretty/v6 v6.3.0 h1:QQ5yZPDUMEjbZRXDJtZlvwfDQqCYFaxV3yEzTkogUgk=
github.com/jedib0t/go-pretty/v6 v6.2.7/go.mod h1:FMkOpgGD3EZ91cW8g/96RfxoV7bdeJyzXPYgz1L1ln0= github.com/jedib0t/go-pretty/v6 v6.3.0/go.mod h1:FMkOpgGD3EZ91cW8g/96RfxoV7bdeJyzXPYgz1L1ln0=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=