#Oh bummer! Do you remember the title of
1 messages Β· Page 1 of 1 (latest)
Hey @safe matrix π We didn't have a talk, but we did have a Dagger Meetup! And we did get mentioned in a bunch of other talks π
I'd love to learn more about what you'd like to use Dagger for. Then I could point you to resources or we could do a "custom" talk live π
No worries, thanks for following up, Jeremy. My initial thinking was pretty typical ci/cd use-cases. Being able to centralize and standardize build and release patterns for the team would be awesome, primarily Go/Rust - with some python and infra stuff thrown in there. The added features, i.e. caching, that dagger has is a major bonus. I'm initially converting our container build pipelines from GitHub Actions & Containerfile to dagger. Additionally, I do a lot with cloud infra (Terraform, Kubernetes, AWS, etc.) - I may try to do something with that, but I don't have a real clear idea of what/how right now.
That sounds perfect. Feel free to DM me if you want to meet up and chat.
Thanks!
One, probably silly, question while we're here.. using the Go SDK I see there's a publish Function on the Container type, which will build and publish the Container, then there's the Build function, which expects a Dockerfile. Is there such a method or way to use the build function, that will just build the Container? (as defined by the dagger client, not the Dockerfile)
The use-case I'm thinking is a test that verifies that the image builds, without the need to publish it
Got it, so you'd build a container from a Dockerfile? Or would you prefer to start with a base image and add files/packages to it to form the image?
The latter
Something like
client.Container().
From("cgr.dev/chainguard/wolfi-base:latest").
WithFile("/bin/foo", build.File("/src/foo")).
WithEntrypoint([]string{"/bin/foo"}).
Build()
Also useful for building and testing the image locally
ah, got it. Yeah, if possible, I'd check out the newer modules/functions approach. The client is something we used in the previous (still supported) go program approach.
but...regardless, you've got a Dagger Container object already there without the Build(). We sort of blur the liines between container/image, here's an example.
or actually....want to jump in dev-audio channel by any chance?
Ah okay, I'll have a look at the module approach.
I'm just about to head out to get lunch with my wife, but thanks for offering
This gives me plenty to chew on. Thank you!
I'm just going to make an example real quick and then paste it in. No worries.
It'll be here when you're back π
Oh man, thanks! You're awesome
Links to existing videos/github are totally welcome haha
dagger -m github.com/jpadams/example-go-build-container call build --source https://github.com/jpadams/go-hello
dagger -m github.com/jpadams/example-go-build-container call build --source https://github.com/jpadams/go-hello stdout
first one returns the Container.
second one calls the stdout function on the Container to get the output π
You could do that in code too, but it's nice to have the container because you can do a lot with it from the CLI or from code.
dagger call -m github.com/jpadams/example-go-build-container \
build --source https://github.com/jpadams/go-hello publish --help
dagger call -m github.com/jpadams/example-go-build-container \
build --source https://github.com/jpadams/go-hello publish --address ttl.sh/foo-golang-$RANDOM
or of course with a local Directory like
git clone https://github.com/jpadams/go-hello
dagger call -m github.com/jpadams/example-go-build-container \
build --source https://github.com/jpadams/go-hello --source ./go-hello stdout
https://github.com/jpadams/example-go-build-container/blob/main/main.go
// An example module building a binary and putting it in a container
package main
type Foo struct{}
// Builds go proj from Directory builds Container
func (m *Foo) Build(source *Directory) *Container {
build := dag.Container().
From("cgr.dev/chainguard/go:latest").
WithMountedDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"build", "-o", "foo"})
return dag.Container().
From("cgr.dev/chainguard/wolfi-base:latest").
WithFile("/bin/foo", build.File("/src/foo")).
WithEntrypoint([]string{"/bin/foo"})
}
Awesome, thank you so much!
This was SUPER helpful, thanks! You all should pull that together in a tutorial in your docs
Thanks @safe matrix ! I was thinking similar.
In fact that's a big goal this quarter, to make the Daggerverse and docs more valuable for folks getting started/with particular use-cases.
If you can think of any tools that you think do a great job with that or have specific suggestions, please let me know/open an issue π
@harsh python ideation in progress π
Hashi + Terraform does a pretty good job
Their docs are all really thorough and they have a ton of well written tutorials w/ related git repos
π
we have a quickstart with some element of that, which @summer jasper is actively rewriting based on user feedback from the last few weeks. So now is the perfect time for this discussion. π
Awesome! Happy to give any feedback if you guys want it
If you feel so inclined, I'm sure a github issue with your requests & suggestions for docs, would be very appreciated!
Good call. https://github.com/dagger/dagger/issues/7157
thank you!
@safe matrix thanks for opening the issue! I noted this in particular: ...more importantly, how quickly get started with it in my project. In our current quickstart, we have a section on this in the latter half called Daggerize your project, but it sounds like you'd like that type of content to be more detailed and also more front and center?
@summer jasper thanks for following up. That tutorial does cover a good amount of the content. The workshop goes into a lot more detail and includes building a module locally, which I think helps the user get a deeper understanding - both consuming existing modules, but also creating & using their own in the project.
Though the next doc there, https://docs.dagger.io/quickstart/428201/custom-function, I think covers the majority of it.
I think the majority of what's in the quickstart probably covers the issue I've opened. I think it would still be beneficial to turn the frontend/backend project that your team walked through in the workshop video into a proper tutorial though. Feel free to close my issue if you feel that's not necessary and the quick start covers it.
Thanks @safe matrix ! I'm working on improving the quickstart, would you be interested in reviewing the PR once ready?