#Oh bummer! Do you remember the title of

1 messages Β· Page 1 of 1 (latest)

versed vapor
#

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 πŸ˜„

safe matrix
#

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.

versed vapor
#

That sounds perfect. Feel free to DM me if you want to meet up and chat.

safe matrix
#

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

versed vapor
safe matrix
#

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

versed vapor
#

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?

safe matrix
#

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!

versed vapor
#

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 πŸ˜„

safe matrix
#

Oh man, thanks! You're awesome

#

Links to existing videos/github are totally welcome haha

versed vapor
safe matrix
#

excellent, thanks!

#

Argh. Kicking myself for missing that meetup.

versed vapor
#
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"})
}
safe matrix
#

Awesome, thank you so much!

safe matrix
versed vapor
#

@harsh python ideation in progress πŸ‘†

safe matrix
#

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

harsh python
#

πŸ‘€

#

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. πŸ™

safe matrix
#

Awesome! Happy to give any feedback if you guys want it

harsh python
#

If you feel so inclined, I'm sure a github issue with your requests & suggestions for docs, would be very appreciated!

safe matrix
harsh python
summer jasper
#

@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?

safe matrix
#

@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.

#

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.

summer jasper
#

Thanks @safe matrix ! I'm working on improving the quickstart, would you be interested in reviewing the PR once ready?