Proposal to refine docker deployment#1302
Proposal to refine docker deployment#1302gdbelvin merged 2 commits intogoogle:masterfrom DazWilkin:docker-proposal
Conversation
| build: | ||
| context: ../trillian | ||
| dockerfile: examples/deployment/docker/log_server/Dockerfile | ||
| image: us.gcr.io/trillian/log-server:latest |
There was a problem hiding this comment.
I both love and dislike :latest
It both fetches the "latest" image - great. But it also prevents kubectl apply from updating the image when "latest" change. I don't know what the best practices are around this, but "latest" has given me a lot of heartburn keeping the CI environment up-to-date.
There was a problem hiding this comment.
Yes, I don't recommend :latest either. Apologies... It was a shortcut to not having a better way to grab the latest release of Trillian's images.
|
@DazWilkin Thank you very much for giving the Docker files some much needed love.
|
|
@gdbelvin in issue #1300 I was receiving build errors. The error results from the build's context not having a I suspect the break was either Modules being added to Trillian|KT, or KT's Dockerfiles being changed to root from |
* master: (106 commits) Remove unused logVerifier (google#1324) Verify Revisions in StreamRevisions (google#1323) Pair verifier functions (google#1322) Split VerifyRevision into Verify{LogRoot,MapRevision (google#1318) Make Previous hash check optional (google#1307) Remove VerifySignedMapRoot from VerifierInterface (google#1320) Remove trailing whitespace (google#1321) Encapsulate Client Verifier State in test vectors (google#1316) Pass along err message (google#1314) Remove unnessesary func() (google#1319) New test vector transcript format (google#1315) Track map revision inside mutation (google#1310) Move verifier to its own package (google#1312) go generate ./... (google#1306) Fix proto copying in revisions and paginator tests. (google#1309) Fix proto copying in server_test. (google#1308) go mod tidy (google#1305) Use new TrillianMapWrite API (google#1304) Configurable maximum queue depth for metric reporting. (google#1303) Proposal to refine docker deployment (google#1302) ...
* master: (95 commits) Remove unused logVerifier (google#1324) Verify Revisions in StreamRevisions (google#1323) Pair verifier functions (google#1322) Split VerifyRevision into Verify{LogRoot,MapRevision (google#1318) Make Previous hash check optional (google#1307) Remove VerifySignedMapRoot from VerifierInterface (google#1320) Remove trailing whitespace (google#1321) Encapsulate Client Verifier State in test vectors (google#1316) Pass along err message (google#1314) Remove unnessesary func() (google#1319) New test vector transcript format (google#1315) Track map revision inside mutation (google#1310) Move verifier to its own package (google#1312) go generate ./... (google#1306) Fix proto copying in revisions and paginator tests. (google#1309) Fix proto copying in server_test. (google#1308) go mod tidy (google#1305) Use new TrillianMapWrite API (google#1304) Configurable maximum queue depth for metric reporting. (google#1303) Proposal to refine docker deployment (google#1302) ...
Triggered by my challenges using KeyTransparency's (KT's) docker-compose (#1300)
This is a proposal to streamline the use of docker-compose and the container images.
It will not (yet) work as-is.
0. CI|CD Key Transparency Server often unavailable
The CI|CD deployment rarely works and the KT server (
35.202.56.9:443) is generally inaccessible. This makes the need for a user-deployable mechanism more important. The solution for docker-compose exists and is the easiest solution.1. Go Modules
The use of Go Modules (appears to) cause problems with the docker-compose builds. The Dockerfiles were being referenced from
github.com/googleand this directory contains nogo.modfiles. This resulted in issues for thedocker buildcommands. Splitting KT and Trillian (see #2) allows the build context to be more appropriately set togithub.com/google/keytransparencyand this does contain ago.modand the issue goes away.2. Disconnect KT and Trillian
Currently KT's docker-compose will rebuild Trillian images as-needed. I think this is too strong a dependency and that -- ideally -- KT should reference "golden" images for the Trillian components through a repository, e.g.
us.gcr.io/trillian/log-server.3. Switch to Distroless
Trillian's images are built using Distroless. Recommend switching KT's. This reduces the resulting image sizes and -- as a consequence -- reduces the scope of vulnerabilities.
There is one downside to this. The
distroless/baseimage does not includecurl. The docker-compose healthchecks usecurlto check endpoints. These no longer work with distroless. An alternative is to add a simple Golang healthcheck that can be included in the Dockerfile and referenced from the Dockerfile and|or docker-compose.4. Sequencer configuration issue
The
sequencerservice configuration did not explicitly--tls-keyand--tls-certto point to the genfiles mapped to/kt/in the container.