What would be the best way to include to sqlc in the Docker build process?
#803
Replies: 3 comments
-
|
I think your approach of directly referencing the binary is better than building sqlc from source. It should be faster and less prone to build errors. Another option would be to use the official sqlc Docker image (https://hub.docker.com/r/kjconroy/sqlc) and multistage builds. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
|
That could be a good alternative as well! I am going with the downloaded binary for now. Will let you know if I encounter some downsides of this approach. |
Beta Was this translation helpful? Give feedback.
-
|
Starting with Go 1.16, which will be released in February, it will be easier to do a version-specific global installation.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a typical docker image like:
BUT, now I would also like to perform the
sqlc generatebefore building my program's binary.I was thinking about doing something like this:
But this is failing atm right in the
go getpart for the master and I would like to locksqlcto a specific version. 1.5.0 or this incoming 1.6.0.How would you recommend to include the
sqlcin the docker building process please?Update:
For now, it seems I got it working with:
And then:
But not if there is a better way.
Originally posted by @EnchanterIO in #788 (comment)
Beta Was this translation helpful? Give feedback.
All reactions