status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/container_test.go
Exec struct { Exec struct { Stdout struct { Contents string } } } } } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "node:18.10.0-alpine") { withMountedDirectory(path: "/mnt", source: $id) { exec(args: ["sh", "-c", "node --version >> /mnt/versions"]) { from(address: "golang:1.18.2-alpine") { exec(args: ["sh", "-c", "go version >> /mnt/versions"]) { exec(args: ["cat", "/mnt/versions"]) { stdout { contents } } } } } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/container_test.go
} } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.NoError(t, err) require.Contains(t, execRes.Container.From.WithMountedDirectory.Exec.From.Exec.Exec.Stdout.Contents, "v18.10.0\n") require.Contains(t, execRes.Container.From.WithMountedDirectory.Exec.From.Exec.Exec.Stdout.Contents, "go version go1.18.2") } func TestContainerPublish(t *testing.T) { ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() randomID := identity.NewID() go func() { err := c.Do(ctx, &dagger.Request{ Query: `query RunRegistry($rand: String!) { container { from(address: "registry:2") { withEnvVariable(name: "RANDOM", value: $rand) { exec(args: ["/etc/docker/registry/config.yml"]) { stdout { contents } stderr {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/container_test.go
contents } } } } } }`, Variables: map[string]any{ "rand": randomID, }, }, &dagger.Response{Data: new(map[string]any)}, ) if err != nil { t.Logf("error running registry: %v", err) } }() err = c.Do(ctx, &dagger.Request{ Query: `query WaitForRegistry($rand: String!) { container { from(address: "alpine:3.16.2") { withEnvVariable(name: "RANDOM", value: $rand) { exec(args: ["sh", "-c", "for i in $(seq 1 60); do nc -zv 127.0.0.1 5000 && exit 0; sleep 1; done; exit 1"]) { stdout { contents } } } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/container_test.go
} }`, Variables: map[string]any{ "rand": randomID, }, }, &dagger.Response{Data: new(map[string]any)}, ) require.NoError(t, err) testRef := core.ContainerAddress("127.0.0.1:5000/testimagepush:latest") err = c.Do(ctx, &dagger.Request{ Query: `query TestImagePush($ref: ContainerAddress!) { container { from(address: "alpine:3.16.2") { publish(address: $ref) } } }`, Variables: map[string]any{ "ref": testRef, }, }, &dagger.Response{Data: new(map[string]any)}, ) require.NoError(t, err) res := struct { Container struct { From struct { Fs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/container_test.go
File struct { Contents string } } } } }{} err = c.Do(ctx, &dagger.Request{ Query: `query TestImagePull($ref: ContainerAddress!) { container { from(address: $ref) { fs { file(path: "/etc/alpine-release") { contents } } } } }`, Variables: map[string]any{ "ref": testRef, }, }, &dagger.Response{Data: &res}, ) require.NoError(t, err) require.Equal(t, res.Container.From.Fs.File.Contents, "3.16.2\n") }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/testdata/codetoschema/main.go
package main import ( "fmt" "go.dagger.io/dagger/sdk/go/dagger" "go.dagger.io/dagger/sdk/go/dagger/api" ) func main() { dagger.Serve(Test{}) } type Test struct { } func (Test) RequiredTypes( ctx dagger.Context, str string, i int, b bool, strukt AllTheTypes, strArray []string, intArray []int, boolArray []bool, ) (string, error) { return fmt.Sprintf("%s %d %t %+v %v %v %v", str, i, b, strukt, strArray, intArray, boolArray), nil } func (Test) OptionalTypes(
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/testdata/codetoschema/main.go
ctx dagger.Context, str *string, i *int, b *bool, strArray []*string, intArray []*int, boolArray []*bool, ) (string, error) { return fmt.Sprintf("%s %s %s %s %s %s", ptrFormat(str), ptrFormat(i), ptrFormat(b), ptrArrayFormat(strArray), ptrArrayFormat(intArray), ptrArrayFormat(boolArray)), nil } func (Test) OptionalReturn(ctx dagger.Context, returnNil bool) (*string, error) { if returnNil { return nil, nil } s := "not nil" return &s, nil } func (Test) IntArrayReturn(ctx dagger.Context, intArray []int) ([]int, error) { return intArray, nil } func (Test) StringArrayReturn(ctx dagger.Context, strArray []*string) ([]*string, error) { return strArray, nil } func (Test) StructReturn(ctx dagger.Context, strukt AllTheTypes) (AllTheTypes, error) { return strukt, nil } func (Test) ParentResolver(ctx dagger.Context, str string) (SubResolver, error) { return SubResolver{Str: str}, nil } type SubResolver struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/testdata/codetoschema/main.go
Str string } func (s SubResolver) SubField(ctx dagger.Context, str string) (string, error) { return s.Str + "-" + str, nil } func (Test) ReturnDirectory(ctx dagger.Context, ref api.ContainerAddress) (*api.Directory, error) { client, err := dagger.Connect(ctx) if err != nil { return nil, err } defer client.Close() return client.Core().Container().From(ref).FS(), nil } type AllTheTypes struct { Str string Int int Bool bool StrArray []string IntArray []int BoolArray []bool SubStruct AllTheSubTypes } type AllTheSubTypes struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/integration/testdata/codetoschema/main.go
SubStr string SubInt int SubBool bool SubStrArray []string SubIntArray []int SubBoolArray []bool } func ptrFormat[T any](p *T) string { if p == nil { return "<nil>" } return fmt.Sprintf("%v", *p) } func ptrArrayFormat[T any](s []*T) string { if s == nil { return "<nil>" } var out []string for _, str := range s { out = append(out, ptrFormat(str)) } return fmt.Sprintf("%v", out) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
package schema import ( "fmt" "path" "strings" specs "github.com/opencontainers/image-spec/specs-go/v1" "go.dagger.io/dagger/core" "go.dagger.io/dagger/router" ) type containerSchema struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
*baseSchema } var _ router.ExecutableSchema = &containerSchema{} func (s *containerSchema) Name() string { return "container" } func (s *containerSchema) Schema() string { return Container } func (s *containerSchema) Resolvers() router.Resolvers { return router.Resolvers{ "ContainerID": stringResolver(core.ContainerID("")), "ContainerAddress": stringResolver(core.ContainerAddress("")), "Query": router.ObjectResolver{ "container": router.ToResolver(s.container), }, "Container": router.ObjectResolver{ "from": router.ToResolver(s.from), "build": router.ToResolver(s.build), "fs": router.ToResolver(s.fs), "withFS": router.ToResolver(s.withFS), "file": router.ToResolver(s.file), "directory": router.ToResolver(s.directory), "user": router.ToResolver(s.user), "withUser": router.ToResolver(s.withUser),
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
"workdir": router.ToResolver(s.workdir), "withWorkdir": router.ToResolver(s.withWorkdir), "envVariables": router.ToResolver(s.envVariables), "envVariable": router.ToResolver(s.envVariable), "withEnvVariable": router.ToResolver(s.withEnvVariable), "withSecretVariable": router.ToResolver(s.withSecretVariable), "withoutEnvVariable": router.ToResolver(s.withoutEnvVariable), "entrypoint": router.ToResolver(s.entrypoint), "withEntrypoint": router.ToResolver(s.withEntrypoint), "defaultArgs": router.ToResolver(s.defaultArgs), "withDefaultArgs": router.ToResolver(s.withDefaultArgs), "mounts": router.ToResolver(s.mounts), "withMountedDirectory": router.ToResolver(s.withMountedDirectory), "withMountedFile": router.ToResolver(s.withMountedFile), "withMountedTemp": router.ToResolver(s.withMountedTemp), "withMountedCache": router.ToResolver(s.withMountedCache), "withMountedSecret": router.ToResolver(s.withMountedSecret), "withoutMount": router.ToResolver(s.withoutMount), "exec": router.ToResolver(s.exec), "exitCode": router.ToResolver(s.exitCode), "stdout": router.ToResolver(s.stdout), "stderr": router.ToResolver(s.stderr), "publish": router.ToResolver(s.publish), }, } } func (s *containerSchema) Dependencies() []router.ExecutableSchema { return nil } type containerArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
ID core.ContainerID } func (s *containerSchema) container(ctx *router.Context, parent any, args containerArgs) (*core.Container, error) { return &core.Container{ ID: args.ID, }, nil } type containerFromArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Address core.ContainerAddress } func (s *containerSchema) from(ctx *router.Context, parent *core.Container, args containerFromArgs) (*core.Container, error) { return parent.From(ctx, s.gw, string(args.Address), s.platform) } type containerBuildArgs struct { Context core.DirectoryID Dockerfile string } func (s *containerSchema) build(ctx *router.Context, parent *core.Container, args containerBuildArgs) (*core.Container, error) { return parent.Build(ctx, s.gw, &core.Directory{ID: args.Context}, args.Dockerfile, s.platform) } func (s *containerSchema) withFS(ctx *router.Context, parent *core.Container, arg core.Directory) (*core.Container, error) { ctr, err := parent.WithFS(ctx, &arg, s.platform) if err != nil { return nil, err } return ctr, nil } func (s *containerSchema) fs(ctx *router.Context, parent *core.Container, args any) (*core.Directory, error) { return parent.FS(ctx) } type containerExecArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
core.ContainerExecOpts } func (s *containerSchema) exec(ctx *router.Context, parent *core.Container, args containerExecArgs) (*core.Container, error) { return parent.Exec(ctx, s.gw, args.ContainerExecOpts) } func (s *containerSchema) exitCode(ctx *router.Context, parent *core.Container, args any) (*int, error) { return parent.ExitCode(ctx, s.gw) } func (s *containerSchema) stdout(ctx *router.Context, parent *core.Container, args any) (*core.File, error) { return parent.MetaFile(ctx, s.gw, "stdout") } func (s *containerSchema) stderr(ctx *router.Context, parent *core.Container, args any) (*core.File, error) { return parent.MetaFile(ctx, s.gw, "stderr") } type containerWithEntrypointArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Args []string } func (s *containerSchema) withEntrypoint(ctx *router.Context, parent *core.Container, args containerWithEntrypointArgs) (*core.Container, error) { return parent.UpdateImageConfig(ctx, func(cfg specs.ImageConfig) specs.ImageConfig { cfg.Entrypoint = args.Args return cfg }) } func (s *containerSchema) entrypoint(ctx *router.Context, parent *core.Container, args containerWithVariableArgs) ([]string, error) { cfg, err := parent.ImageConfig(ctx) if err != nil { return nil, err } return cfg.Entrypoint, nil } type containerWithDefaultArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Args *[]string } func (s *containerSchema) withDefaultArgs(ctx *router.Context, parent *core.Container, args containerWithDefaultArgs) (*core.Container, error) { return parent.UpdateImageConfig(ctx, func(cfg specs.ImageConfig) specs.ImageConfig { if args.Args == nil { cfg.Cmd = []string{} return cfg } cfg.Cmd = *args.Args return cfg }) } func (s *containerSchema) defaultArgs(ctx *router.Context, parent *core.Container, args any) ([]string, error) { cfg, err := parent.ImageConfig(ctx) if err != nil { return nil, err } return cfg.Cmd, nil } type containerWithUserArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Name string } func (s *containerSchema) withUser(ctx *router.Context, parent *core.Container, args containerWithUserArgs) (*core.Container, error) { return parent.UpdateImageConfig(ctx, func(cfg specs.ImageConfig) specs.ImageConfig { cfg.User = args.Name return cfg }) } func (s *containerSchema) user(ctx *router.Context, parent *core.Container, args containerWithVariableArgs) (string, error) { cfg, err := parent.ImageConfig(ctx) if err != nil { return "", err } return cfg.User, nil } type containerWithWorkdirArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Path string } func (s *containerSchema) withWorkdir(ctx *router.Context, parent *core.Container, args containerWithWorkdirArgs) (*core.Container, error) { return parent.UpdateImageConfig(ctx, func(cfg specs.ImageConfig) specs.ImageConfig { cfg.WorkingDir = absPath(cfg.WorkingDir, args.Path) return cfg }) } func (s *containerSchema) workdir(ctx *router.Context, parent *core.Container, args containerWithVariableArgs) (string, error) { cfg, err := parent.ImageConfig(ctx) if err != nil { return "", err } return cfg.WorkingDir, nil } type containerWithVariableArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Name string Value string } func (s *containerSchema) withEnvVariable(ctx *router.Context, parent *core.Container, args containerWithVariableArgs) (*core.Container, error) { return parent.UpdateImageConfig(ctx, func(cfg specs.ImageConfig) specs.ImageConfig { newEnv := []string{} prefix := args.Name + "=" for _, env := range cfg.Env { if !strings.HasPrefix(env, prefix) { newEnv = append(newEnv, env) } } newEnv = append(newEnv, fmt.Sprintf("%s=%s", args.Name, args.Value)) cfg.Env = newEnv return cfg }) } type containerWithoutVariableArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Name string } func (s *containerSchema) withoutEnvVariable(ctx *router.Context, parent *core.Container, args containerWithoutVariableArgs) (*core.Container, error) { return parent.UpdateImageConfig(ctx, func(cfg specs.ImageConfig) specs.ImageConfig { removedEnv := []string{} prefix := args.Name + "=" for _, env := range cfg.Env { if !strings.HasPrefix(env, prefix) { removedEnv = append(removedEnv, env) } } cfg.Env = removedEnv return cfg }) } type EnvVariable struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Name string `json:"name"` Value string `json:"value"` } func (s *containerSchema) envVariables(ctx *router.Context, parent *core.Container, args any) ([]EnvVariable, error) { cfg, err := parent.ImageConfig(ctx) if err != nil { return nil, err } vars := make([]EnvVariable, 0, len(cfg.Env)) for _, v := range cfg.Env { name, value, _ := strings.Cut(v, "=") e := EnvVariable{ Name: name, Value: value, } vars = append(vars, e) } return vars, nil } type containerVariableArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Name string } func (s *containerSchema) envVariable(ctx *router.Context, parent *core.Container, args containerVariableArgs) (*string, error) { cfg, err := parent.ImageConfig(ctx) if err != nil { return nil, err } for _, env := range cfg.Env { name, val, ok := strings.Cut(env, "=") if ok && name == args.Name { return &val, nil } } return nil, nil } type containerWithMountedDirectoryArgs struct { Path string Source core.DirectoryID } func (s *containerSchema) withMountedDirectory(ctx *router.Context, parent *core.Container, args containerWithMountedDirectoryArgs) (*core.Container, error) { return parent.WithMountedDirectory(ctx, args.Path, &core.Directory{ID: args.Source}) } type containerPublishArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Address core.ContainerAddress } func (s *containerSchema) publish(ctx *router.Context, parent *core.Container, args containerPublishArgs) (core.ContainerAddress, error) { return parent.Publish(ctx, args.Address, s.bkClient, s.solveOpts, s.solveCh) } type containerWithMountedFileArgs struct { Path string Source core.FileID } func (s *containerSchema) withMountedFile(ctx *router.Context, parent *core.Container, args containerWithMountedFileArgs) (*core.Container, error) { return parent.WithMountedFile(ctx, args.Path, &core.File{ID: args.Source}) } type containerWithMountedCacheArgs struct { Path string Cache core.CacheID Source core.DirectoryID } func (s *containerSchema) withMountedCache(ctx *router.Context, parent *core.Container, args containerWithMountedCacheArgs) (*core.Container, error) { var dir *core.Directory if args.Source != "" { dir = &core.Directory{ID: args.Source} } return parent.WithMountedCache(ctx, args.Path, args.Cache, dir) } type containerWithMountedTempArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Path string } func (s *containerSchema) withMountedTemp(ctx *router.Context, parent *core.Container, args containerWithMountedTempArgs) (*core.Container, error) { return parent.WithMountedTemp(ctx, args.Path) } type containerWithoutMountArgs struct { Path string } func (s *containerSchema) withoutMount(ctx *router.Context, parent *core.Container, args containerWithoutMountArgs) (*core.Container, error) { return parent.WithoutMount(ctx, args.Path) } func (s *containerSchema) mounts(ctx *router.Context, parent *core.Container, _ any) ([]string, error) { return parent.Mounts(ctx) } type containerDirectoryArgs struct { Path string } func (s *containerSchema) directory(ctx *router.Context, parent *core.Container, args containerDirectoryArgs) (*core.Directory, error) { return parent.Directory(ctx, s.gw, args.Path) } type containerFileArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
core/schema/container.go
Path string } func (s *containerSchema) file(ctx *router.Context, parent *core.Container, args containerFileArgs) (*core.File, error) { return parent.File(ctx, s.gw, args.Path) } func absPath(workDir string, containerPath string) string { if path.IsAbs(containerPath) { return containerPath } if workDir == "" { workDir = "/" } return path.Join(workDir, containerPath) } type containerWithSecretVariableArgs struct { Name string Secret core.SecretID } func (s *containerSchema) withSecretVariable(ctx *router.Context, parent *core.Container, args containerWithSecretVariableArgs) (*core.Container, error) { return parent.WithSecretVariable(ctx, args.Name, &core.Secret{ID: args.Secret}) } type containerWithMountedSecretArgs struct { Path string Source core.SecretID } func (s *containerSchema) withMountedSecret(ctx *router.Context, parent *core.Container, args containerWithMountedSecretArgs) (*core.Container, error) { return parent.WithMountedSecret(ctx, args.Path, core.NewSecret(args.Source)) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
package api import ( "context" "github.com/Khan/genqlient/graphql" "go.dagger.io/dagger/sdk/go/dagger/querybuilder" ) func New(c graphql.Client) *Query { return &Query{ q: querybuilder.Query(), c: c, } } type GraphQLMarshaller interface { GraphQLType() string GraphQLMarshal(ctx context.Context) (any, error) } type CacheID string func (s CacheID) GraphQLType() string { return "CacheID" } func (s CacheID) GraphQLMarshal(ctx context.Context) (any, error) { return string(s), nil } type ContainerAddress string func (s ContainerAddress) GraphQLType() string { return "ContainerAddress"
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
} func (s ContainerAddress) GraphQLMarshal(ctx context.Context) (any, error) { return string(s), nil } type ContainerID string func (s ContainerID) GraphQLType() string { return "ContainerID" } func (s ContainerID) GraphQLMarshal(ctx context.Context) (any, error) { return string(s), nil } type DirectoryID string func (s DirectoryID) GraphQLType() string { return "DirectoryID" } func (s DirectoryID) GraphQLMarshal(ctx context.Context) (any, error) { return string(s), nil } type FileID string func (s FileID) GraphQLType() string { return "FileID" } func (s FileID) GraphQLMarshal(ctx context.Context) (any, error) { return string(s), nil } type HostDirectoryID string func (s HostDirectoryID) GraphQLType() string { return "HostDirectoryID" } func (s HostDirectoryID) GraphQLMarshal(ctx context.Context) (any, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
return string(s), nil } type SecretID string func (s SecretID) GraphQLType() string { return "SecretID" } func (s SecretID) GraphQLMarshal(ctx context.Context) (any, error) { return string(s), nil } type CacheVolume struct { q *querybuilder.Selection c graphql.Client } func (r *CacheVolume) ID(ctx context.Context) (CacheID, error) { q := r.q.Select("id") var response CacheID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *CacheVolume) GraphQLType() string { return "CacheVolume" } func (r *CacheVolume) GraphQLMarshal(ctx context.Context) (any, error) { id, err := r.ID(ctx) if err != nil { return nil, err } return map[string]any{"id": id}, nil } type Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } type ContainerBuildOpts struct { Dockerfile string } func (r *Container) Build(context DirectoryID, opts ...ContainerBuildOpts) *Container { q := r.q.Select("build") q = q.Arg("context", context) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Dockerfile) { q = q.Arg("dockerfile", opts[i].Dockerfile) break } } return &Container{ q: q, c: r.c, } } func (r *Container) DefaultArgs(ctx context.Context) ([]string, error) { q := r.q.Select("defaultArgs") var response []string q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
return response, q.Execute(ctx, r.c) } func (r *Container) Directory(path string) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } func (r *Container) Entrypoint(ctx context.Context) ([]string, error) { q := r.q.Select("entrypoint") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) EnvVariable(ctx context.Context, name string) (string, error) { q := r.q.Select("envVariable") q = q.Arg("name", name) var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error) { q := r.q.Select("envVariables") var response []EnvVariable q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerExecOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
Args []string RedirectStderr string RedirectStdout string Stdin string } func (r *Container) Exec(opts ...ContainerExecOpts) *Container { q := r.q.Select("exec") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Args) { q = q.Arg("args", opts[i].Args) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStderr) { q = q.Arg("redirectStderr", opts[i].RedirectStderr) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStdout) { q = q.Arg("redirectStdout", opts[i].RedirectStdout) break } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Stdin) { q = q.Arg("stdin", opts[i].Stdin) break } } return &Container{ q: q, c: r.c, } } func (r *Container) ExitCode(ctx context.Context) (int, error) { q := r.q.Select("exitCode") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) File(path string) *File { q := r.q.Select("file") q = q.Arg("path", path) return &File{ q: q, c: r.c, } } func (r *Container) From(address ContainerAddress) *Container { q := r.q.Select("from") q = q.Arg("address", address) return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
c: r.c, } } func (r *Container) FS() *Directory { q := r.q.Select("fs") return &Directory{ q: q, c: r.c, } } func (r *Container) ID(ctx context.Context) (ContainerID, error) { q := r.q.Select("id") var response ContainerID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) GraphQLType() string { return "Container" } func (r *Container) GraphQLMarshal(ctx context.Context) (any, error) { id, err := r.ID(ctx) if err != nil { return nil, err } return map[string]any{"id": id}, nil } func (r *Container) Mounts(ctx context.Context) ([]string, error) { q := r.q.Select("mounts") var response []string q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
return response, q.Execute(ctx, r.c) } func (r *Container) Publish(ctx context.Context, address ContainerAddress) (ContainerAddress, error) { q := r.q.Select("publish") q = q.Arg("address", address) var response ContainerAddress q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Stderr() *File { q := r.q.Select("stderr") return &File{ q: q, c: r.c, } } func (r *Container) Stdout() *File { q := r.q.Select("stdout") return &File{ q: q, c: r.c, } } func (r *Container) User(ctx context.Context) (string, error) { q := r.q.Select("user") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerWithDefaultArgsOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
Args []string } func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container { q := r.q.Select("withDefaultArgs") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Args) { q = q.Arg("args", opts[i].Args) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithEntrypoint(args []string) *Container { q := r.q.Select("withEntrypoint") q = q.Arg("args", args) return &Container{ q: q, c: r.c, }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
} func (r *Container) WithEnvVariable(name string, value string) *Container { q := r.q.Select("withEnvVariable") q = q.Arg("name", name) q = q.Arg("value", value) return &Container{ q: q, c: r.c, } } func (r *Container) WithFS(id DirectoryID) *Container { q := r.q.Select("withFS") q = q.Arg("id", id) return &Container{ q: q, c: r.c, } } type ContainerWithMountedCacheOpts struct { Source DirectoryID } func (r *Container) WithMountedCache(cache CacheID, path string, opts ...ContainerWithMountedCacheOpts) *Container { q := r.q.Select("withMountedCache") q = q.Arg("cache", cache) q = q.Arg("path", path) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Source) { q = q.Arg("source", opts[i].Source) break
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
} } return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedDirectory(path string, source DirectoryID) *Container { q := r.q.Select("withMountedDirectory") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedFile(path string, source FileID) *Container { q := r.q.Select("withMountedFile") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedSecret(path string, source SecretID) *Container { q := r.q.Select("withMountedSecret") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q: q, c: r.c, } } func (r *Container) WithMountedTemp(path string) *Container { q := r.q.Select("withMountedTemp") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithSecretVariable(name string, secret SecretID) *Container { q := r.q.Select("withSecretVariable") q = q.Arg("name", name) q = q.Arg("secret", secret) return &Container{ q: q, c: r.c, } } func (r *Container) WithUser(name string) *Container { q := r.q.Select("withUser") q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } func (r *Container) WithWorkdir(path string) *Container {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q := r.q.Select("withWorkdir") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutEnvVariable(name string) *Container { q := r.q.Select("withoutEnvVariable") q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutMount(path string) *Container { q := r.q.Select("withoutMount") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) Workdir(ctx context.Context) (string, error) { q := r.q.Select("workdir") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Directory struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *Directory) Diff(other DirectoryID) *Directory { q := r.q.Select("diff") q = q.Arg("other", other) return &Directory{ q: q, c: r.c, } } func (r *Directory) Directory(path string) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type DirectoryEntriesOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
Path string } func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error) { q := r.q.Select("entries") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Path) { q = q.Arg("path", opts[i].Path) break } } var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) File(path string) *File { q := r.q.Select("file") q = q.Arg("path", path) return &File{ q: q, c: r.c, } } func (r *Directory) ID(ctx context.Context) (DirectoryID, error) { q := r.q.Select("id") var response DirectoryID
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) GraphQLType() string { return "Directory" } func (r *Directory) GraphQLMarshal(ctx context.Context) (any, error) { id, err := r.ID(ctx) if err != nil { return nil, err } return map[string]any{"id": id}, nil } func (r *Directory) LoadProject(configPath string) *Project { q := r.q.Select("loadProject") q = q.Arg("configPath", configPath) return &Project{ q: q, c: r.c, } } func (r *Directory) WithCopiedFile(path string, source FileID) *Directory { q := r.q.Select("withCopiedFile") q = q.Arg("path", path) q = q.Arg("source", source) return &Directory{ q: q, c: r.c, } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
func (r *Directory) WithDirectory(directory DirectoryID, path string) *Directory { q := r.q.Select("withDirectory") q = q.Arg("directory", directory) q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type DirectoryWithNewFileOpts struct { Contents string } func (r *Directory) WithNewFile(path string, opts ...DirectoryWithNewFileOpts) *Directory { q := r.q.Select("withNewFile") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Contents) { q = q.Arg("contents", opts[i].Contents) break } } q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } func (r *Directory) WithoutDirectory(path string) *Directory { q := r.q.Select("withoutDirectory") q = q.Arg("path", path)
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
return &Directory{ q: q, c: r.c, } } func (r *Directory) WithoutFile(path string) *Directory { q := r.q.Select("withoutFile") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type EnvVariable struct { q *querybuilder.Selection c graphql.Client } func (r *EnvVariable) Name(ctx context.Context) (string, error) { q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *EnvVariable) Value(ctx context.Context) (string, error) { q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type File struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *File) Contents(ctx context.Context) (string, error) { q := r.q.Select("contents") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) ID(ctx context.Context) (FileID, error) { q := r.q.Select("id") var response FileID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) GraphQLType() string { return "File" } func (r *File) GraphQLMarshal(ctx context.Context) (any, error) { id, err := r.ID(ctx) if err != nil { return nil, err } return map[string]any{"id": id}, nil } func (r *File) Secret() *Secret {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q := r.q.Select("secret") return &Secret{ q: q, c: r.c, } } func (r *File) Size(ctx context.Context) (int, error) { q := r.q.Select("size") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type GitRef struct { q *querybuilder.Selection c graphql.Client } func (r *GitRef) Digest(ctx context.Context) (string, error) { q := r.q.Select("digest") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *GitRef) Tree() *Directory { q := r.q.Select("tree") return &Directory{ q: q, c: r.c, } } type GitRepository struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *GitRepository) Branch(name string) *GitRef { q := r.q.Select("branch") q = q.Arg("name", name) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Branches(ctx context.Context) ([]string, error) { q := r.q.Select("branches") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *GitRepository) Tag(name string) *GitRef { q := r.q.Select("tag") q = q.Arg("name", name) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Tags(ctx context.Context) ([]string, error) { q := r.q.Select("tags") var response []string q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
return response, q.Execute(ctx, r.c) } type Host struct { q *querybuilder.Selection c graphql.Client } func (r *Host) Directory(id HostDirectoryID) *HostDirectory { q := r.q.Select("directory") q = q.Arg("id", id) return &HostDirectory{ q: q, c: r.c, } } func (r *Host) Variable(name string) *HostVariable { q := r.q.Select("variable") q = q.Arg("name", name) return &HostVariable{ q: q, c: r.c, } } func (r *Host) Workdir() *HostDirectory { q := r.q.Select("workdir") return &HostDirectory{ q: q, c: r.c, } } type HostDirectory struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *HostDirectory) Read() *Directory { q := r.q.Select("read") return &Directory{ q: q, c: r.c, } } type HostDirectoryWriteOpts struct { Path string } func (r *HostDirectory) Write(ctx context.Context, contents DirectoryID, opts ...HostDirectoryWriteOpts) (bool, error) { q := r.q.Select("write") q = q.Arg("contents", contents) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Path) { q = q.Arg("path", opts[i].Path) break } } var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type HostVariable struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *HostVariable) Secret() *Secret { q := r.q.Select("secret") return &Secret{ q: q, c: r.c, } } func (r *HostVariable) Value(ctx context.Context) (string, error) { q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Project struct { q *querybuilder.Selection c graphql.Client } func (r *Project) Extensions(ctx context.Context) ([]Project, error) { q := r.q.Select("extensions") var response []Project q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) GeneratedCode() *Directory { q := r.q.Select("generatedCode")
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
return &Directory{ q: q, c: r.c, } } func (r *Project) Install(ctx context.Context) (bool, error) { q := r.q.Select("install") var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) Name(ctx context.Context) (string, error) { q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) Schema(ctx context.Context) (string, error) { q := r.q.Select("schema") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) SDK(ctx context.Context) (string, error) { q := r.q.Select("sdk") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Query struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *Query) CacheVolume(key string) *CacheVolume { q := r.q.Select("cacheVolume") q = q.Arg("key", key) return &CacheVolume{ q: q, c: r.c, } } type ContainerOpts struct { ID ContainerID } func (r *Query) Container(opts ...ContainerOpts) *Container { q := r.q.Select("container") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ID) { q = q.Arg("id", opts[i].ID) break } } return &Container{ q: q, c: r.c, } } type DirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
ID DirectoryID } func (r *Query) Directory(opts ...DirectoryOpts) *Directory { q := r.q.Select("directory") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ID) { q = q.Arg("id", opts[i].ID) break } } return &Directory{ q: q, c: r.c, } } func (r *Query) File(id FileID) *File { q := r.q.Select("file") q = q.Arg("id", id) return &File{ q: q, c: r.c, } } func (r *Query) Git(url string) *GitRepository { q := r.q.Select("git") q = q.Arg("url", url) return &GitRepository{ q: q, c: r.c,
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
} } func (r *Query) Host() *Host { q := r.q.Select("host") return &Host{ q: q, c: r.c, } } func (r *Query) HTTP(url string) *File { q := r.q.Select("http") q = q.Arg("url", url) return &File{ q: q, c: r.c, } } func (r *Query) Project(name string) *Project { q := r.q.Select("project") q = q.Arg("name", name) return &Project{ q: q, c: r.c, } } func (r *Query) Secret(id SecretID) *Secret { q := r.q.Select("secret") q = q.Arg("id", id) return &Secret{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
3,257
Replace `ContainerAddress` with a regular string
per https://github.com/dagger/dagger/pull/3219#discussion_r987337784 We generally use scalars for opaque values that pass through the client without ever being modified or constructed directly. `ContainerAddress` on the other hand is a user-provided string, and having to cast it to this special type is a little weird. Also, we currently use regular strings for paths (e.g. `withNewFile(path: String!)`), so it seems a little inconsistent to opt for a scalar type for image addresses but not paths.
https://github.com/dagger/dagger/issues/3257
https://github.com/dagger/dagger/pull/3443
3c9cbd207ec1c5950d3c2ae55fc555356026c682
311a1205797776e318bf979c748b538fbf80e2dd
2022-10-04T22:04:40Z
go
2022-10-19T22:59:53Z
sdk/go/dagger/api/api.gen.go
c: r.c, } } type Secret struct { q *querybuilder.Selection c graphql.Client } func (r *Secret) ID(ctx context.Context) (SecretID, error) { q := r.q.Select("id") var response SecretID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Secret) GraphQLType() string { return "Secret" } func (r *Secret) GraphQLMarshal(ctx context.Context) (any, error) { id, err := r.ID(ctx) if err != nil { return nil, err } return map[string]any{"id": id}, nil } func (r *Secret) Plaintext(ctx context.Context) (string, error) { q := r.q.Select("plaintext") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
package core import ( "context" "encoding/json" "fmt" "path" "strconv" "strings" "github.com/containerd/containerd/platforms" "github.com/dagger/dagger/core/shim" "github.com/docker/distribution/reference" bkclient "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/exporter/containerimage/exptypes" dockerfilebuilder "github.com/moby/buildkit/frontend/dockerfile/builder" bkgw "github.com/moby/buildkit/frontend/gateway/client" "github.com/moby/buildkit/solver/pb" "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) type Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
ID ContainerID `json:"id"` } type ContainerID string func (id ContainerID) decode() (*containerIDPayload, error) { if id == "" { return &containerIDPayload{}, nil } var payload containerIDPayload if err := decodeID(&payload, id); err != nil { return nil, err } return &payload, nil } type containerIDPayload struct { FS *pb.Definition `json:"fs"` Config specs.ImageConfig `json:"cfg"` Mounts []ContainerMount `json:"mounts,omitempty"` Meta *pb.Definition `json:"meta,omitempty"` Platform specs.Platform `json:"platform,omitempty"` Secrets []ContainerSecret `json:"secret_env,omitempty"` } type ContainerSecret struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
Secret SecretID `json:"secret"` EnvName string `json:"env,omitempty"` MountPath string `json:"path,omitempty"` } func (payload *containerIDPayload) Encode() (ContainerID, error) { id, err := encodeID(payload) if err != nil { return "", err } return ContainerID(id), nil } func (payload *containerIDPayload) FSState() (llb.State, error) { if payload.FS == nil { return llb.Scratch(), nil } return defToState(payload.FS) } const metaMount = "/dagger" const metaSourcePath = "meta" func (payload *containerIDPayload) MetaState() (*llb.State, error) { if payload.Meta == nil { return nil, nil } metaSt, err := defToState(payload.Meta) if err != nil { return nil, err } return &metaSt, nil } type ContainerMount struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
Source *pb.Definition `json:"source,omitempty"` SourcePath string `json:"source_path,omitempty"` Target string `json:"target"` CacheID string `json:"cache_id,omitempty"` CacheSharingMode string `json:"cache_sharing,omitempty"` Tmpfs bool `json:"tmpfs,omitempty"` } func (mnt ContainerMount) SourceState() (llb.State, error) { if mnt.Source == nil { return llb.Scratch(), nil } return defToState(mnt.Source) } func (container *Container) From(ctx context.Context, gw bkgw.Client, addr string, platform specs.Platform) (*Container, error) { refName, err := reference.ParseNormalizedNamed(addr) if err != nil { return nil, err } ref := reference.TagNameOnly(refName).String() _, cfgBytes, err := gw.ResolveImageConfig(ctx, ref, llb.ResolveImageConfigOpt{ Platform: &platform, ResolveMode: llb.ResolveModeDefault.String(), }) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
return nil, err } var imgSpec specs.Image if err := json.Unmarshal(cfgBytes, &imgSpec); err != nil { return nil, err } dir, err := NewDirectory(ctx, llb.Image(addr), "/", platform) if err != nil { return nil, err } ctr, err := container.WithFS(ctx, dir, platform) if err != nil { return nil, err } return ctr.UpdateImageConfig(ctx, func(specs.ImageConfig) specs.ImageConfig { return imgSpec.Config }) } func (container *Container) Build(ctx context.Context, gw bkgw.Client, context *Directory, dockerfile string, platform specs.Platform) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } ctxPayload, err := context.ID.Decode() if err != nil { return nil, err } opts := map[string]string{ "platform": platforms.Format(platform), "filename": dockerfile,
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
} inputs := map[string]*pb.Definition{ dockerfilebuilder.DefaultLocalNameContext: ctxPayload.LLB, dockerfilebuilder.DefaultLocalNameDockerfile: ctxPayload.LLB, } res, err := gw.Solve(ctx, bkgw.SolveRequest{ Frontend: "dockerfile.v0", FrontendOpt: opts, FrontendInputs: inputs, }) if err != nil { return nil, err } bkref, err := res.SingleRef() if err != nil { return nil, err } st, err := bkref.ToState() if err != nil { return nil, err } def, err := st.Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, err } payload.FS = def.ToPB() payload.Platform = platform cfgBytes, found := res.Metadata[exptypes.ExporterImageConfigKey] if found { var imgSpec specs.Image
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
if err := json.Unmarshal(cfgBytes, &imgSpec); err != nil { return nil, err } payload.Config = imgSpec.Config } id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) FS(ctx context.Context) (*Directory, error) { payload, err := container.ID.decode() if err != nil { return nil, err } return (&directoryIDPayload{ LLB: payload.FS, Platform: payload.Platform, }).ToDirectory() } func (container *Container) WithFS(ctx context.Context, dir *Directory, platform specs.Platform) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } dirPayload, err := dir.ID.Decode() if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
payload.FS = dirPayload.LLB payload.Platform = platform id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithMountedDirectory(ctx context.Context, target string, source *Directory) (*Container, error) { payload, err := source.ID.Decode() if err != nil { return nil, err } return container.withMounted(target, payload.LLB, payload.Dir) } func (container *Container) WithMountedFile(ctx context.Context, target string, source *File) (*Container, error) { payload, err := source.ID.decode() if err != nil { return nil, err } return container.withMounted(target, payload.LLB, payload.File) } func (container *Container) WithMountedCache(ctx context.Context, target string, cache CacheID, source *Directory) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } cachePayload, err := cache.decode() if err != nil { return nil, err
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
} target = absPath(payload.Config.WorkingDir, target) mount := ContainerMount{ Target: target, CacheID: cachePayload.Sum(), CacheSharingMode: "shared", } if source != nil { srcPayload, err := source.ID.Decode() if err != nil { return nil, err } mount.Source = srcPayload.LLB mount.SourcePath = srcPayload.Dir } payload.Mounts = append(payload.Mounts, mount) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithMountedTemp(ctx context.Context, target string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) payload.Mounts = append(payload.Mounts, ContainerMount{ Target: target,
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
Tmpfs: true, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithMountedSecret(ctx context.Context, target string, source *Secret) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) payload.Secrets = append(payload.Secrets, ContainerSecret{ Secret: source.ID, MountPath: target, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithoutMount(ctx context.Context, target string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target)
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
var found bool var foundIdx int for i := len(payload.Mounts) - 1; i >= 0; i-- { if payload.Mounts[i].Target == target { found = true foundIdx = i break } } if found { payload.Mounts = append(payload.Mounts[:foundIdx], payload.Mounts[foundIdx+1:]...) } id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) Mounts(ctx context.Context) ([]string, error) { payload, err := container.ID.decode() if err != nil { return nil, err } mounts := []string{} for _, mnt := range payload.Mounts { mounts = append(mounts, mnt.Target) } return mounts, nil } func (container *Container) WithSecretVariable(ctx context.Context, name string, secret *Secret) (*Container, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
payload, err := container.ID.decode() if err != nil { return nil, err } payload.Secrets = append(payload.Secrets, ContainerSecret{ Secret: secret.ID, EnvName: name, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) Directory(ctx context.Context, gw bkgw.Client, dirPath string) (*Directory, error) { dir, err := locatePath(ctx, container, dirPath, gw, NewDirectory) if err != nil { return nil, err } info, err := dir.Stat(ctx, gw, ".") if err != nil { return nil, err } if !info.IsDir() { return nil, fmt.Errorf("path %s is a file, not a directory", dirPath) } return dir, nil }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
func (container *Container) File(ctx context.Context, gw bkgw.Client, filePath string) (*File, error) { file, err := locatePath(ctx, container, filePath, gw, NewFile) if err != nil { return nil, err } info, err := file.Stat(ctx, gw) if err != nil { return nil, err } if info.IsDir() { return nil, fmt.Errorf("path %s is a directory, not a file", filePath) } return file, nil } func locatePath[T *File | *Directory]( ctx context.Context, container *Container, containerPath string, gw bkgw.Client, init func(context.Context, llb.State, string, specs.Platform) (T, error), ) (T, error) { payload, err := container.ID.decode() if err != nil { return nil, err } containerPath = absPath(payload.Config.WorkingDir, containerPath) var found T
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
for i := len(payload.Mounts) - 1; i >= 0; i-- { mnt := payload.Mounts[i] if containerPath == mnt.Target || strings.HasPrefix(containerPath, mnt.Target+"/") { if mnt.Tmpfs { return nil, fmt.Errorf("%s: cannot retrieve path from tmpfs", containerPath) } if mnt.CacheID != "" { return nil, fmt.Errorf("%s: cannot retrieve path from cache", containerPath) } st, err := mnt.SourceState() if err != nil { return nil, err } sub := mnt.SourcePath if containerPath != mnt.Target { dirSub := strings.TrimPrefix(containerPath, mnt.Target+"/") if dirSub != "" { sub = path.Join(sub, dirSub) } } found, err = init(ctx, st, sub, payload.Platform) if err != nil { return nil, err } break } } if found == nil { st, err := payload.FSState()
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
if err != nil { return nil, err } found, err = init(ctx, st, containerPath, payload.Platform) if err != nil { return nil, err } } return found, nil } func (container *Container) withMounted(target string, srcDef *pb.Definition, srcPath string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) payload.Mounts = append(payload.Mounts, ContainerMount{ Source: srcDef, SourcePath: srcPath, Target: target, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) ImageConfig(ctx context.Context) (specs.ImageConfig, error) { payload, err := container.ID.decode() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
return specs.ImageConfig{}, err } return payload.Config, nil } func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } payload.Config = updateFn(payload.Config) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) Exec(ctx context.Context, gw bkgw.Client, opts ContainerExecOpts) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, fmt.Errorf("decode id: %w", err) } cfg := payload.Config mounts := payload.Mounts platform := payload.Platform shimSt, err := shim.Build(ctx, gw, platform) if err != nil { return nil, fmt.Errorf("build shim: %w", err) } args := opts.Args if len(args) == 0 {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
args = cfg.Cmd } if len(cfg.Entrypoint) > 0 { args = append(cfg.Entrypoint, args...) } runOpts := []llb.RunOption{ llb.AddMount(shim.Path, shimSt, llb.SourcePath(shim.Path)), llb.Args(append([]string{shim.Path}, args...)), llb.WithCustomName(strings.Join(args, " ")), } meta := llb.Mkdir(metaSourcePath, 0777) if opts.Stdin != "" { meta = meta.Mkfile(path.Join(metaSourcePath, "stdin"), 0600, []byte(opts.Stdin)) } runOpts = append(runOpts, llb.AddMount(metaMount, llb.Scratch().File(meta), llb.SourcePath(metaSourcePath))) if opts.RedirectStdout != "" { runOpts = append(runOpts, llb.AddEnv("_DAGGER_REDIRECT_STDOUT", opts.RedirectStdout)) } if opts.RedirectStderr != "" { runOpts = append(runOpts, llb.AddEnv("_DAGGER_REDIRECT_STDERR", opts.RedirectStderr))
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
} if cfg.User != "" { runOpts = append(runOpts, llb.User(cfg.User)) } if cfg.WorkingDir != "" { runOpts = append(runOpts, llb.Dir(cfg.WorkingDir)) } for _, env := range cfg.Env { name, val, ok := strings.Cut(env, "=") if !ok { _ = ok } runOpts = append(runOpts, llb.AddEnv(name, val)) } for i, secret := range payload.Secrets { secretOpts := []llb.SecretOption{llb.SecretID(string(secret.Secret))} var secretDest string switch { case secret.EnvName != "": secretDest = secret.EnvName secretOpts = append(secretOpts, llb.SecretAsEnv(true)) case secret.MountPath != "": secretDest = secret.MountPath default: return nil, fmt.Errorf("malformed secret config at index %d", i) } runOpts = append(runOpts, llb.AddSecret(secretDest, secretOpts...)) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
fsSt, err := payload.FSState() if err != nil { return nil, fmt.Errorf("fs state: %w", err) } execSt := fsSt.Run(runOpts...) for i, mnt := range mounts { srcSt, err := mnt.SourceState() if err != nil { return nil, fmt.Errorf("mount %s: %w", mnt.Target, err) } mountOpts := []llb.MountOption{} if mnt.SourcePath != "" { mountOpts = append(mountOpts, llb.SourcePath(mnt.SourcePath)) } if mnt.CacheSharingMode != "" { var sharingMode llb.CacheMountSharingMode switch mnt.CacheSharingMode { case "shared": sharingMode = llb.CacheMountShared case "private": sharingMode = llb.CacheMountPrivate case "locked": sharingMode = llb.CacheMountLocked default: return nil, errors.Errorf("invalid cache mount sharing mode %q", mnt.CacheSharingMode) } mountOpts = append(mountOpts, llb.AsPersistentCacheDir(mnt.CacheID, sharingMode)) } if mnt.Tmpfs { mountOpts = append(mountOpts, llb.Tmpfs())
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
} mountSt := execSt.AddMount(mnt.Target, srcSt, mountOpts...) if !mnt.Tmpfs && mnt.CacheID == "" { execMountDef, err := mountSt.Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, fmt.Errorf("propagate %s: %w", mnt.Target, err) } mounts[i].Source = execMountDef.ToPB() } } execDef, err := execSt.Root().Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, fmt.Errorf("marshal root: %w", err) } metaDef, err := execSt.GetMount(metaMount).Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, fmt.Errorf("get meta mount: %w", err) } payload.FS = execDef.ToPB() payload.Mounts = mounts payload.Meta = metaDef.ToPB() id, err := payload.Encode() if err != nil { return nil, fmt.Errorf("encode: %w", err) } return &Container{ID: id}, nil } func (container *Container) ExitCode(ctx context.Context, gw bkgw.Client) (*int, error) { file, err := container.MetaFile(ctx, gw, "exitCode")
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
if err != nil { return nil, err } if file == nil { return nil, nil } content, err := file.Contents(ctx, gw) if err != nil { return nil, err } exitCode, err := strconv.Atoi(string(content)) if err != nil { return nil, err } return &exitCode, nil } func (container *Container) MetaFile(ctx context.Context, gw bkgw.Client, filePath string) (*File, error) { payload, err := container.ID.decode() if err != nil { return nil, err } meta, err := payload.MetaState() if err != nil { return nil, err } if meta == nil { return nil, nil } return NewFile(ctx, *meta, path.Join(metaSourcePath, filePath), payload.Platform) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
func (container *Container) Publish( ctx context.Context, ref string, bkClient *bkclient.Client, solveOpts bkclient.SolveOpt, solveCh chan<- *bkclient.SolveStatus, ) (string, error) { payload, err := container.ID.decode() if err != nil { return "", err } st, err := payload.FSState() if err != nil { return "", err } stDef, err := st.Marshal(ctx, llb.Platform(payload.Platform)) if err != nil { return "", err } cfgBytes, err := json.Marshal(specs.Image{ Architecture: payload.Platform.Architecture, OS: payload.Platform.OS, OSVersion: payload.Platform.OSVersion, OSFeatures: payload.Platform.OSFeatures, Config: payload.Config, }) if err != nil { return "", err }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
solveOpts.Exports = []bkclient.ExportEntry{ { Type: bkclient.ExporterImage, Attrs: map[string]string{ "name": ref, "push": "true", }, }, } ch := make(chan *bkclient.SolveStatus) go func() { for event := range ch { solveCh <- event } }() res, err := bkClient.Build(ctx, solveOpts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) { res, err := gw.Solve(ctx, bkgw.SolveRequest{ Evaluate: true, Definition: stDef.ToPB(), }) if err != nil { return nil, err } res.AddMeta(exptypes.ExporterImageConfigKey, cfgBytes) return res, nil }, ch) if err != nil { return "", err
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/container.go
} refName, err := reference.ParseNormalizedNamed(ref) if err != nil { return "", err } imageDigest, found := res.ExporterResponse[exptypes.ExporterImageDigestKey] if found { dig, err := digest.Parse(imageDigest) if err != nil { return "", fmt.Errorf("parse digest: %w", err) } withDig, err := reference.WithDigest(refName, dig) if err != nil { return "", fmt.Errorf("with digest: %w", err) } return withDig.String(), nil } return ref, nil } type ContainerExecOpts struct { Args []string Stdin string RedirectStdout string RedirectStderr string }
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/shim/cmd/main.go
package main import ( "fmt" "io" "os" "os/exec" ) const ( stdinPath = "/dagger/stdin" exitCodePath = "/dagger/exitCode" ) var ( stdoutPath = "/dagger/stdout" stderrPath = "/dagger/stderr" ) func run() int {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/shim/cmd/main.go
if len(os.Args) < 2 { fmt.Fprintf(os.Stderr, "usage: %s <path> [<args>]\n", os.Args[0]) return 1 } name := os.Args[1] args := []string{} if len(os.Args) > 2 { args = os.Args[2:] } cmd := exec.Command(name, args...) cmd.Env = os.Environ() if stdinFile, err := os.Open(stdinPath); err == nil { defer stdinFile.Close() cmd.Stdin = stdinFile } else { cmd.Stdin = nil } stdoutRedirect, found := internalEnv("_DAGGER_REDIRECT_STDOUT") if found { stdoutPath = stdoutRedirect
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/shim/cmd/main.go
} stdoutFile, err := os.Create(stdoutPath) if err != nil { panic(err) } defer stdoutFile.Close() cmd.Stdout = io.MultiWriter(stdoutFile, os.Stdout) stderrRedirect, found := internalEnv("_DAGGER_REDIRECT_STDERR") if found { stderrPath = stderrRedirect } stderrFile, err := os.Create(stderrPath) if err != nil { panic(err) } defer stderrFile.Close() cmd.Stderr = io.MultiWriter(stderrFile, os.Stderr) exitCode := 0 if err := cmd.Run(); err != nil { exitCode = 1 if exiterr, ok := err.(*exec.ExitError); ok { exitCode = exiterr.ExitCode() } } if err := os.WriteFile(exitCodePath, []byte(fmt.Sprintf("%d", exitCode)), 0600); err != nil { panic(err) } return exitCode } func internalEnv(name string) (string, bool) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,407
Cloak's mount at `/dagger` for `stdout` and `stderr` shadows user content there
I build a Jenkins agent image for running Dagger on Jenkins. I happened to put the `dagger` binary at `/dagger` on my image (and symlink to it from `/usr/local/bin/dagger`). That works okay because I'm running Dagger *from* my image, but if I run a cloak/Dagger query that uses my image, the fact that we mount to `/dagger` clobbers/shadows my content there. We should either move this or document it. Repro: this works: ``` docker run -it --rm jeremyatdockerhub/cloak-jenkins-agent:15 /dagger/dagger ``` this doesn't: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["/dagger/dagger"]) { stdout { contents } } } } } EOF ... #14 /dagger/dagger #14 ERROR: process "/_shim /dagger/dagger" did not complete successfully: exit code: 1 ------ ``` because: ``` /usr/local/bin/dagger do <<EOF query JDK { container { from(address: "jeremyatdockerhub/cloak-jenkins-agent:15") { exec(args: ["ls", "/dagger"]) { stdout { contents } } } } } EOF ... #14 ls /dagger #0 0.164 stderr #0 0.164 stdout #14 DONE 0.2s { "container": { "from": { "exec": { "stdout": { "contents": "stderr\nstdout\n" } } } } } ``` fyi @aluzzardi
https://github.com/dagger/dagger/issues/3407
https://github.com/dagger/dagger/pull/3548
26f77b8cd2dd481988986e54b11ec21ec83fad39
ab7fba6ce6611a5eb0c279f8db42bb45b1cca11f
2022-10-17T17:25:25Z
go
2022-10-25T23:43:46Z
core/shim/cmd/main.go
val, found := os.LookupEnv(name) if !found { return "", false } os.Unsetenv(name) return val, true } func main() { os.Exit(run()) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
package core import ( "context" "encoding/json" "fmt" "path" "strconv" "strings" "github.com/containerd/containerd/platforms" "github.com/dagger/dagger/core/shim" "github.com/docker/distribution/reference" bkclient "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/exporter/containerimage/exptypes" dockerfilebuilder "github.com/moby/buildkit/frontend/dockerfile/builder" bkgw "github.com/moby/buildkit/frontend/gateway/client" "github.com/moby/buildkit/solver/pb" "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) type Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
ID ContainerID `json:"id"` } type ContainerID string func (id ContainerID) decode() (*containerIDPayload, error) { if id == "" { return &containerIDPayload{}, nil } var payload containerIDPayload if err := decodeID(&payload, id); err != nil { return nil, err } return &payload, nil } type containerIDPayload struct { FS *pb.Definition `json:"fs"` Config specs.ImageConfig `json:"cfg"` Mounts []ContainerMount `json:"mounts,omitempty"` Meta *pb.Definition `json:"meta,omitempty"` Platform specs.Platform `json:"platform,omitempty"` Secrets []ContainerSecret `json:"secret_env,omitempty"` } type ContainerSecret struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
Secret SecretID `json:"secret"` EnvName string `json:"env,omitempty"` MountPath string `json:"path,omitempty"` } func (payload *containerIDPayload) Encode() (ContainerID, error) { id, err := encodeID(payload) if err != nil { return "", err } return ContainerID(id), nil } func (payload *containerIDPayload) FSState() (llb.State, error) { if payload.FS == nil { return llb.Scratch(), nil } return defToState(payload.FS) } const metaMount = "/.dagger_meta_mount" const metaSourcePath = "meta" func (payload *containerIDPayload) MetaState() (*llb.State, error) { if payload.Meta == nil { return nil, nil } metaSt, err := defToState(payload.Meta) if err != nil { return nil, err } return &metaSt, nil } type ContainerMount struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
Source *pb.Definition `json:"source,omitempty"` SourcePath string `json:"source_path,omitempty"` Target string `json:"target"` CacheID string `json:"cache_id,omitempty"` CacheSharingMode string `json:"cache_sharing,omitempty"` Tmpfs bool `json:"tmpfs,omitempty"` } func (mnt ContainerMount) SourceState() (llb.State, error) { if mnt.Source == nil { return llb.Scratch(), nil }
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
return defToState(mnt.Source) } func (container *Container) From(ctx context.Context, gw bkgw.Client, addr string, platform specs.Platform) (*Container, error) { refName, err := reference.ParseNormalizedNamed(addr) if err != nil { return nil, err } ref := reference.TagNameOnly(refName).String() _, cfgBytes, err := gw.ResolveImageConfig(ctx, ref, llb.ResolveImageConfigOpt{ Platform: &platform, ResolveMode: llb.ResolveModeDefault.String(), }) if err != nil { return nil, err } var imgSpec specs.Image if err := json.Unmarshal(cfgBytes, &imgSpec); err != nil { return nil, err } dir, err := NewDirectory(ctx, llb.Image(addr), "/", platform) if err != nil { return nil, err } ctr, err := container.WithFS(ctx, dir, platform) if err != nil { return nil, err } return ctr.UpdateImageConfig(ctx, func(specs.ImageConfig) specs.ImageConfig { return imgSpec.Config })
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
} func (container *Container) Build(ctx context.Context, gw bkgw.Client, context *Directory, dockerfile string, platform specs.Platform) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } ctxPayload, err := context.ID.Decode() if err != nil { return nil, err } opts := map[string]string{ "platform": platforms.Format(platform), "filename": dockerfile, } inputs := map[string]*pb.Definition{ dockerfilebuilder.DefaultLocalNameContext: ctxPayload.LLB, dockerfilebuilder.DefaultLocalNameDockerfile: ctxPayload.LLB, } res, err := gw.Solve(ctx, bkgw.SolveRequest{ Frontend: "dockerfile.v0", FrontendOpt: opts, FrontendInputs: inputs, }) if err != nil { return nil, err } bkref, err := res.SingleRef() if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
st, err := bkref.ToState() if err != nil { return nil, err } def, err := st.Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, err } payload.FS = def.ToPB() payload.Platform = platform cfgBytes, found := res.Metadata[exptypes.ExporterImageConfigKey] if found { var imgSpec specs.Image if err := json.Unmarshal(cfgBytes, &imgSpec); err != nil { return nil, err } payload.Config = imgSpec.Config } id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) FS(ctx context.Context) (*Directory, error) { payload, err := container.ID.decode() if err != nil { return nil, err } return (&directoryIDPayload{
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
LLB: payload.FS, Platform: payload.Platform, }).ToDirectory() } func (container *Container) WithFS(ctx context.Context, dir *Directory, platform specs.Platform) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } dirPayload, err := dir.ID.Decode() if err != nil { return nil, err } payload.FS = dirPayload.LLB payload.Platform = platform id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithMountedDirectory(ctx context.Context, target string, source *Directory) (*Container, error) { payload, err := source.ID.Decode() if err != nil { return nil, err } return container.withMounted(target, payload.LLB, payload.Dir) } func (container *Container) WithMountedFile(ctx context.Context, target string, source *File) (*Container, error) { payload, err := source.ID.decode()
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
if err != nil { return nil, err } return container.withMounted(target, payload.LLB, payload.File) } func (container *Container) WithMountedCache(ctx context.Context, target string, cache CacheID, source *Directory) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } cachePayload, err := cache.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) mount := ContainerMount{ Target: target, CacheID: cachePayload.Sum(), CacheSharingMode: "shared", } if source != nil { srcPayload, err := source.ID.Decode() if err != nil { return nil, err } mount.Source = srcPayload.LLB mount.SourcePath = srcPayload.Dir } payload.Mounts = append(payload.Mounts, mount) id, err := payload.Encode()
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithMountedTemp(ctx context.Context, target string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) payload.Mounts = append(payload.Mounts, ContainerMount{ Target: target, Tmpfs: true, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithMountedSecret(ctx context.Context, target string, source *Secret) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) payload.Secrets = append(payload.Secrets, ContainerSecret{ Secret: source.ID, MountPath: target,
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
}) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) WithoutMount(ctx context.Context, target string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } target = absPath(payload.Config.WorkingDir, target) var found bool var foundIdx int for i := len(payload.Mounts) - 1; i >= 0; i-- { if payload.Mounts[i].Target == target { found = true foundIdx = i break } } if found { payload.Mounts = append(payload.Mounts[:foundIdx], payload.Mounts[foundIdx+1:]...) } id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
} func (container *Container) Mounts(ctx context.Context) ([]string, error) { payload, err := container.ID.decode() if err != nil { return nil, err } mounts := []string{} for _, mnt := range payload.Mounts { mounts = append(mounts, mnt.Target) } return mounts, nil } func (container *Container) WithSecretVariable(ctx context.Context, name string, secret *Secret) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } payload.Secrets = append(payload.Secrets, ContainerSecret{ Secret: secret.ID, EnvName: name, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) Directory(ctx context.Context, gw bkgw.Client, dirPath string) (*Directory, error) { dir, err := locatePath(ctx, container, dirPath, gw, NewDirectory) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
return nil, err } info, err := dir.Stat(ctx, gw, ".") if err != nil { return nil, err } if !info.IsDir() { return nil, fmt.Errorf("path %s is a file, not a directory", dirPath) } return dir, nil } func (container *Container) File(ctx context.Context, gw bkgw.Client, filePath string) (*File, error) { file, err := locatePath(ctx, container, filePath, gw, NewFile) if err != nil { return nil, err } info, err := file.Stat(ctx, gw) if err != nil { return nil, err } if info.IsDir() { return nil, fmt.Errorf("path %s is a directory, not a file", filePath) } return file, nil } func locatePath[T *File | *Directory](
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
ctx context.Context, container *Container, containerPath string, gw bkgw.Client, init func(context.Context, llb.State, string, specs.Platform) (T, error), ) (T, error) { payload, err := container.ID.decode() if err != nil { return nil, err } containerPath = absPath(payload.Config.WorkingDir, containerPath) var found T for i := len(payload.Mounts) - 1; i >= 0; i-- { mnt := payload.Mounts[i] if containerPath == mnt.Target || strings.HasPrefix(containerPath, mnt.Target+"/") { if mnt.Tmpfs { return nil, fmt.Errorf("%s: cannot retrieve path from tmpfs", containerPath) } if mnt.CacheID != "" { return nil, fmt.Errorf("%s: cannot retrieve path from cache", containerPath) } st, err := mnt.SourceState() if err != nil { return nil, err } sub := mnt.SourcePath
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
if containerPath != mnt.Target { dirSub := strings.TrimPrefix(containerPath, mnt.Target+"/") if dirSub != "" { sub = path.Join(sub, dirSub) } } found, err = init(ctx, st, sub, payload.Platform) if err != nil { return nil, err } break } } if found == nil { st, err := payload.FSState() if err != nil { return nil, err } found, err = init(ctx, st, containerPath, payload.Platform) if err != nil { return nil, err } } return found, nil } func (container *Container) withMounted(target string, srcDef *pb.Definition, srcPath string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err
closed
dagger/dagger
https://github.com/dagger/dagger
3,571
Container: `build` does not respect context subdirectory
This does not currently work: ```go workdir := client.Host().Workdir() app, err := workdir.Read().Directory("app/").ID(ctx) if err != nil { return err } runtime := client.Container().Build(app) ``` The `app/` part gets ignored when using the `dockerfile.v0` frontend. This path is embedded in the `DirectoryID` but it's currently ignored. It looks like this should be configurable: https://github.com/moby/buildkit/blob/46f6f51822ffe7f7764307aa8fa882ded6688002/frontend/dockerfile/builder/build.go#L59 Make sure this works as expected with given `Dockerfile` paths too; the path param should always be relative to the internal subdir of the `DirectoryID`.
https://github.com/dagger/dagger/issues/3571
https://github.com/dagger/dagger/pull/3597
b8491b8679a3775ccf4fbed1592c615df41cbb7a
68f3e1d54d59f9d4c6fcd2c540e8f0e4067ab853
2022-10-26T23:11:42Z
go
2022-10-29T01:11:40Z
core/container.go
} target = absPath(payload.Config.WorkingDir, target) payload.Mounts = append(payload.Mounts, ContainerMount{ Source: srcDef, SourcePath: srcPath, Target: target, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) ImageConfig(ctx context.Context) (specs.ImageConfig, error) { payload, err := container.ID.decode() if err != nil { return specs.ImageConfig{}, err } return payload.Config, nil } func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } payload.Config = updateFn(payload.Config) id, err := payload.Encode() if err != nil { return nil, err }