forked from jmartin82/mmock
-
Notifications
You must be signed in to change notification settings - Fork 0
update Dockerfile to allow us to use tucows certs #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jdietrich-tc
wants to merge
1
commit into
tucows:master
Choose a base branch
from
jdietrich-tc:add_certs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+27
−6
Open
Changes from all commits
Commits
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,30 +1,51 @@ | ||
| ##################################################### | ||
| # use following command to build a release | ||
| # | ||
| # docker login artifacts.cnco.tucows.systems | ||
| # | ||
| # NOTE: replace x.y with the version number | ||
| # | ||
| # docker buildx build -t artifacts.cnco.tucows.systems/mse-platform-docker/tucows-mmock:latest -t artifacts.cnco.tucows.systems/mse-platform-docker/tucows-mmock:x.y . | ||
| # | ||
| # after building push new version | ||
| # | ||
| # docker push artifacts.cnco.tucows.systems/mse-platform-docker/tucows-mmock:latest | ||
| # | ||
| # NOTE: replace x.y with the version number | ||
| # | ||
| # docker push artifacts.cnco.tucows.systems/mse-platform-docker/tucows-mmock:x.y | ||
| # | ||
| # after it is built, use this to run it | ||
| # docker run -it artifacts.cnco.tucows.systems/mse-platform-docker/tucows-mmock:latest | ||
| ### builder | ||
| FROM golang:alpine as builder | ||
|
|
||
| WORKDIR /app | ||
| COPY . . | ||
| RUN --mount=type=cache,target=/go/pkg/mod \ | ||
| --mount=type=cache,target=/root/.cache/go-build \ | ||
| go build -v -o /bin/mmock cmd/mmock/main.go | ||
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ | ||
| go build -tags netgo -a -v -o /bin/mmock cmd/mmock/main.go | ||
|
|
||
| ##################################################### | ||
| ### release | ||
| FROM alpine as release | ||
|
|
||
| RUN apk --no-cache add \ | ||
| ca-certificates curl | ||
| ca-certificates curl bash | ||
|
|
||
| RUN mkdir /config | ||
| RUN mkdir /tls | ||
|
|
||
| # add tucows root ca | ||
| RUN curl https://vault.prod-hashicorp-ent.bra2.tucows.systems:8200/v1/pki/ca/pem -o /usr/local/share/ca-certificates/tucows-root-ca-v2.crt -k | ||
| RUN update-ca-certificates | ||
|
|
||
| VOLUME /config | ||
|
|
||
| COPY tls/server.crt /tls/server.crt | ||
| COPY tls/server.key /tls/server.key | ||
| COPY --from=builder /bin/mmock /usr/local/bin/mmock | ||
|
|
||
| EXPOSE 8082 8083 8084 | ||
|
|
||
| ENTRYPOINT ["mmock","-config-path","/config","-tls-path","/tls"] | ||
| ENTRYPOINT ["mmock","-config-path","/config"] | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed the tls-path from here, so that it can be set in the nomad var file to point to the nomad secrets dir where the tucows cert is downloaded to. |
||
| CMD ["-server-ip","0.0.0.0","-console-ip","0.0.0.0"] | ||
| HEALTHCHECK --interval=30s --timeout=3s --start-period=3s --retries=2 CMD curl -fsS http://localhost:8082 || exit 1 | ||
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.
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.
Is it a good idea to expose these to public? I didn't think we need to add tucows specific details to the repo. That's why I forked to the tucows org. Maybe it's better to move it to tucowsinc. However we can't fork to private. Have to do it manually.
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.
So, in order to call barndoor, it will need to have the tucows cert. It may not need to be defined here though... It is possible this can be removed and it will still work, as the nomad job and var file (hosted privately) can do it on its own. let me test.