This repository was archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Simplify, cleanup and update docker files #763
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8ad3e6d
WIP: simplify and update docker files
liamsi ca7afb1
Everything works as expected
liamsi 8cf4e17
Add entrypoint to Dockerfiles, update kube config, rename key/cert
liamsi a159173
Merge remote-tracking branch 'origin/master' into docker_update
liamsi 26a5a8b
remove log-key from kube config
liamsi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,44 +1,14 @@ | ||
| FROM golang | ||
|
|
||
| ENV DB_USER=test \ | ||
| DB_PASSWORD=zaphod \ | ||
| DB_DATABASE=test \ | ||
| DB_HOST=db:3306 | ||
|
|
||
| ENV HOST=0.0.0.0 \ | ||
| RPC_PORT=8080 | ||
|
|
||
| # TLS Certificate needs 0.0.0.0 to be in the SAN IP field. | ||
| ENV VRF_PRIV=keytransparency/genfiles/vrf-key.pem \ | ||
| TLS_KEY_PATH=keytransparency/genfiles/server.key \ | ||
| TLS_CRT_PATH=keytransparency/genfiles/server.crt | ||
|
|
||
| ENV MAP_ID=0 \ | ||
| MAP_URL="" | ||
| ENV LOG_ID=0 \ | ||
| LOG_URL=localhost:8090 | ||
|
|
||
| ENV VERBOSITY=1 | ||
|
|
||
| ADD keytransparency/genfiles/* /kt/ | ||
| ADD ./keytransparency /go/src/github.com/google/keytransparency | ||
| ADD ./trillian /go/src/github.com/google/trillian | ||
| WORKDIR /go/src/github.com/google/keytransparency | ||
|
|
||
| RUN apt-get update && apt-get install -y libtool libltdl-dev | ||
| RUN go get -tags="mysql" ./cmd/keytransparency-server | ||
|
|
||
| ENTRYPOINT /go/bin/keytransparency-server \ | ||
| --addr="$HOST:$RPC_PORT" \ | ||
| --db="${DB_USER}:${DB_PASSWORD}@tcp(${DB_HOST})/${DB_DATABASE}" \ | ||
| --vrf="$VRF_PRIV" \ | ||
| --key="$TLS_KEY_PATH" --cert="$TLS_CRT_PATH" \ | ||
| --log-id="$LOG_ID" --log-url="$LOG_URL" \ | ||
| --map-id="$MAP_ID" --map-url="$MAP_URL" \ | ||
| --alsologtostderr \ | ||
| --v=${VERBOSITY} | ||
|
|
||
| EXPOSE $RPC_PORT | ||
| # Specify mandatory flags via the docker command-line or using docker-compose. | ||
| # See the README.md file on how to use docker-compose. | ||
| ENTRYPOINT ["/go/bin/keytransparency-server"] | ||
|
|
||
| HEALTHCHECK --interval=5m --timeout=3s \ | ||
| CMD curl -f http://localhost:$RPC_PORT/debug/vars || exit 1 | ||
| EXPOSE 8080 | ||
This file contains hidden or 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 hidden or 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,32 +1,11 @@ | ||
| FROM golang | ||
|
|
||
| ENV DB_USER=test \ | ||
| DB_PASSWORD=zaphod \ | ||
| DB_DATABASE=test \ | ||
| DB_HOST=127.0.0.0:3306 | ||
|
|
||
| ENV MAP_ID=0 \ | ||
| MAP_URL="" | ||
| ENV LOG_ID=0 \ | ||
| LOG_URL=localhost:8090 \ | ||
| LOG_KEY=trillian/testdata/log-rpc-server.pubkey.pem | ||
|
|
||
| ENV MIN_SIGN_PERIOD=5s \ | ||
| MAX_SIGN_PERIOD=24h | ||
|
|
||
| ENV VERBOSITY=0 | ||
|
|
||
| ADD ./keytransparency /go/src/github.com/google/keytransparency | ||
| ADD ./trillian /go/src/github.com/google/trillian | ||
| WORKDIR /go/src/github.com/google/keytransparency | ||
|
|
||
| RUN apt-get update && apt-get install -y libtool libltdl-dev | ||
| RUN go get -tags="mysql" ./cmd/keytransparency-signer | ||
|
|
||
| ENTRYPOINT /go/bin/keytransparency-signer \ | ||
| --db="${DB_USER}:${DB_PASSWORD}@tcp(${DB_HOST})/${DB_DATABASE}" \ | ||
| --min-period="$MIN_SIGN_PERIOD" --max-period="$MAX_SIGN_PERIOD" \ | ||
| --log-id="$LOG_ID" --log-url="$LOG_URL" \ | ||
| --map-id="$MAP_ID" --map-url="$MAP_URL" \ | ||
| --alsologtostderr --v=${VERBOSITY} | ||
|
|
||
| # Specify mandatory flags via the docker command-line or using docker-compose. | ||
| # See the README.md file on how to use docker-compose. | ||
| ENTRYPOINT ["/go/bin/keytransparency-signer"] |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to set an entry point. Otherwise, it's not possible to add additional arguments via the docker command line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker-compose and kubernetes work though. I'll add an ENTRYPOINT in case someone wants to use the images with any these. Thanks