Skip to content

example docker file#29

Closed
kbudde wants to merge 0 commit intoevenh:masterfrom
kbudde:master
Closed

example docker file#29
kbudde wants to merge 0 commit intoevenh:masterfrom
kbudde:master

Conversation

@kbudde
Copy link
Copy Markdown
Contributor

@kbudde kbudde commented Apr 27, 2019

Hi,

I've created a basic dockerfile for building and running intercert (#28 ).
I've made the configuration file optional to be able to start intercert without config file. Is it possible to configure everything through flags?
More elegant in docker world would be a configuration through environment variables.

You can build it with.

docker build -t intercert . //It will not regenerate proto files

and run the containter with

docker run -p 6300 intercert serve --agree --dns-provider=azure // configure everything via flags

or

docker run -p 6300 -v `pwd`/config.toml:/.intercert/config.toml intercert serve //bind mount config file

Currently I'm not using intercert. So it's just wild guessing if it will working or not. This PR is just a first starting point.

@evenh
Copy link
Copy Markdown
Owner

evenh commented Apr 27, 2019

Thanks for contributing @kbudde! I will review this PR in the next couple of days 👍

Comment thread Dockerfile Outdated
USER nobody:nobody

# Run the compiled binary.
ENTRYPOINT ["/app"] No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nitpick) Missing trailing newline

Comment thread cmd/root.go

// Try to read config
if err := viper.ReadInConfig(); err != nil {
PrintErrorAndExit(err)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change introduced? My thought was to fail as early as possible. However, I see that your message is better.

@evenh
Copy link
Copy Markdown
Owner

evenh commented Apr 28, 2019

Every option should be configurable via flags, with the exception of DNS provider credentials. As far as I know most of the providers (if not all) only support supplying secrets via environment variables (and recently a file on disk as well). This support is provided by the lego library.

I've opened an issue on providing configuration via environment variables, since that is not currently supported (but it ought to be).

The Dockerfile looks good, I've left a few comments. You can respond to them if you'll want to, but it can be merged in it's current state as well without problems.

Thanks again!

@evenh evenh marked this pull request as ready for review April 29, 2019 11:25
@evenh evenh closed this May 1, 2019
@evenh
Copy link
Copy Markdown
Owner

evenh commented May 1, 2019

Sorry, I messed up while applying some fixes. Anyhow, it's now on master 👍. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants