Closed StevenACoffman closed 3 years ago
Do you mean build Cue as a binary from source?
What is the step before Kubernetes?
If you are asking if Cue will build docker images, this is possible and something I have done, but requires using the scripting layer. Cue is a language and doesn't really have knowledge about the domain it's being used for, which includes Kubernetes. The docker part of Nix looks to be more of a framework around packaging and environments, which are the kinds of things for packages around Cue rather than Cue itself.
Yes, build a docker image. Sorry for being unclear.
Specifically, an example demonstrating building a docker image using Cue via the scripting layer.
Typically, at my work the desired sequence is:
I can perform that same sequence from Bash, Go, Makefile, or Nix scripts. I think it's possible to do this with Cue scripts, but I'm not clear on how and would appreciate an example or guidance on where to look.
Assuming you aren't looking to assemble dockerfiles from more abstract Cue designs, and are mainly looking for more complex examples for the tooling layer, check out https://github.com/hofstadter-io/jumpfiles At this point I'm not really looking to use the scripting layer. I'd rather write Go.
I'm actually working on a new scripting lang & shell. I want the ease of bash for working with arbitrary "stuff," and the abilities we typically have to go to a real language for without needing to.
It should definitely be possible to use CUE for Docker images by using the "exec" task type to shell out to the docker binary.
The disadvantage of using Go is that it is hard to reuse workflows, whereas this is easier with CUE.
Yeah, I already am doing this with other tools as follows:
this uses the -t
injection to select into a configuration table with defaults around and just shells out to some script that is constructed in pure Cue. The @tag()
is awesome, but...
I'm really liking my Cue design, Go runtime experiment because attributes are freaking sweet! There's so much possibility here, how much of that can Cue support natively?
v0.1
v0.2
TBH though, the experience of writing _tool.cue
files is not what I want in a scripting system. For example, being required to write command: name: pkg.Func & { .........}
for every thing that can be done in one line today is a step backwards in UX that is tough to accept. (I'm avoiding it for this reason, but I also have a vision for something new brewing, so grain of salt) Another example is testing for a file/dir existence or a ENV val, and then doing something based on that. This is a significant part of scripting and that is highly difficult in Cue, as I understand it should be from Cue's philosophies?
This issue has been migrated to https://github.com/cue-lang/cue/issues/428.
For more details about CUE's migration to a new home, please see https://github.com/cue-lang/cue/issues/1078.
Is your feature request related to a problem? Please describe. I have used Nix to build docker images but I'm not sure how to use Cue in a similar way. The tutorial shows how to use Cue for Kubernetes, but I'm curious if I can use it for the step before.
Describe the solution you'd like I would like a small example documented.
Describe alternatives you've considered Perhaps Cue's scope is currently too limited to achieve this?