<p>I had created my Kubernetes operator with the help of the <a href="https://github.com/operator-framework/operator-sdk" rel="nofollow noreferrer">Operator SDK</a>
Now I want to make some automatic build with my GitHub repo so when I push something to the master to trigger build of the operator image.</p>

<p>Can I use <code>go build + docker build</code> (for building the image) instead of the <code>operator-sdk build</code>?</p>

<p>Because if it is doing the same job I don't want to depend on one more tool for building the image.</p>

<p>I run <code>operator-sdk build</code> with <code>--verbose</code> and it looks like it is doing these only two thing (go build + docker build) but I am not sure. There could be some validations and checks before these command if I don't want to such validations exist I don't want to skip them.</p>

<p>Is a bad idea to use <code>go</code> and <code>docker</code> to directly build the image instead of <code>operator-sdk</code>? Because I don't want to do something special during the build I just want to not have one more dependency in the build infrastructure if it's possible to avoid it.</p>

<p>I faced a similar question and if you look at the source code for <code>operator-sdk</code>, it actually triggers <code>go build</code> and a <code>docker build</code> (the CLI, and not even the APIs for <code>docker build</code>). So yes, I wrote a simple docker file to do a <code>go build</code>. That's it.</p>

<p>EDIT: Here's the source for how the <code>docker build</code> command is formed and finally run as a system command: <a href="https://github.com/operator-framework/operator-sdk/blob/master/cmd/operator-sdk/build/cmd.go#L98" rel="nofollow noreferrer">https://github.com/operator-framework/operator-sdk/blob/master/cmd/operator-sdk/build/cmd.go#L98</a></p>
