-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify from scratch docker - use built in go CA bundle (#146)
Note: the commit steps in the original MR is worth checking * adding local docker test - before addressing #145 * remove alpine test/connect will fail with 16:07:44 [E] 1: Error fetching 18.222.136.83: Get "https://debug.fortio.org/build-test": tls: failed to verify certificate: x509: certificate signed by unknown authority * use fortio/workflows#47 to show failure of image in current state * don't check goreleaser in go checks * meant to not add all the files before but... lets fix the linter first * Making CI fail again until we bump cli package * pre test the cli release, also add negative test * get the non pre release * Move bundle mention to Dockerfile
- Loading branch information
Showing
5 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.DS_Store | ||
coverage.out | ||
.goreleaser.yaml | ||
.golangci.yml | ||
dist/ | ||
multicurl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
FROM alpine as certs | ||
RUN apk update && apk add ca-certificates | ||
# We don't need to copy the CA bundle anymore thanks to | ||
# https://github.com/fortio/cli/releases/tag/v1.6.0 | ||
FROM scratch | ||
COPY multicurl /usr/bin/multicurl | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
ENTRYPOINT ["/usr/bin/multicurl"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
all: clean lint check test-local-image | ||
|
||
test: test-local-image | ||
go test -race ./... | ||
|
||
lint: .golangci.yml | ||
golangci-lint run | ||
|
||
check: .goreleaser.yaml | ||
goreleaser check | ||
|
||
multicurl: # normal one with the bundle through fortio/cli | ||
CGO_ENABLED=0 GOOS=linux go build -a . | ||
|
||
# Will fail because of missing bundle, on purpose, to confirm the negative build tag works. | ||
no-bundle-failing-test: build_no_tls_fallback test-local-image | ||
|
||
build_no_tls_fallback: | ||
CGO_ENABLED=0 GOOS=linux go build -a -tags no_tls_fallback . | ||
|
||
clean: | ||
rm -f multicurl | ||
|
||
test-local-image: multicurl | ||
docker build -t fortio/multicurl:local -f Dockerfile . | ||
docker run --rm fortio/multicurl:local -4 https://debug.fortio.org/build-test | ||
|
||
.golangci.yml: Makefile | ||
curl -fsS -o .golangci.yml https://raw.githubusercontent.com/fortio/workflows/main/golangci.yml | ||
|
||
.goreleaser.yaml: Makefile | ||
curl -fsS -o .goreleaser.yaml https://raw.githubusercontent.com/fortio/workflows/main/goreleaser.yaml # same use branch for testing instead of main in #38 | ||
|
||
.PHONY: lint check all local-image test-local-image no-bundle-failing-test build_no_tls_fallback clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters