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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { WithNewFile struct { File struct { ID core.FileID } } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-dir/sub-file", contents: "sub-content") { file(path: "some-dir/sub-file") { id } } } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.WithNewFile.File.ID execRes := struct { Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
From struct { WithMountedFile struct { WithExec struct { Stdout string } } } } }{} err = testutil.Query( `query Test($id: FileID!) { container { from(address: "alpine:3.16.2") { withMountedFile(path: "/mnt/file", source: $id) { withExec(args: ["cat", "/mnt/file"]) { stdout } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.NoError(t, err) require.Equal(t, "sub-content", execRes.Container.From.WithMountedFile.WithExec.Stdout) } func TestContainerWithMountedCache(t *testing.T) { t.Parallel() cacheID := newCache(t) execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithEnvVariable struct { WithMountedCache struct { WithExec struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Stdout string } } } } } }{} query := `query Test($cache: CacheID!, $rand: String!) { container { from(address: "alpine:3.16.2") { withEnvVariable(name: "RAND", value: $rand) { withMountedCache(path: "/mnt/cache", cache: $cache) { withExec(args: ["sh", "-c", "echo $RAND >> /mnt/cache/file; cat /mnt/cache/file"]) { stdout } } } } } }` rand1 := identity.NewID() err := testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "cache": cacheID, "rand": rand1, }}) require.NoError(t, err) require.Equal(t, rand1+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout) rand2 := identity.NewID() err = testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "cache": cacheID,
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
"rand": rand2, }}) require.NoError(t, err) require.Equal(t, rand1+"\n"+rand2+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout) } func TestContainerWithMountedCacheFromDirectory(t *testing.T) { t.Parallel() dirRes := struct { Directory struct { WithNewFile struct { Directory struct { ID core.FileID } } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-dir/sub-file", contents: "initial-content\n") { directory(path: "some-dir") { id } } } }`, &dirRes, nil) require.NoError(t, err) initialID := dirRes.Directory.WithNewFile.Directory.ID cacheID := newCache(t) execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithEnvVariable struct { WithMountedCache struct { WithExec struct { Stdout string } } } } } }{} query := `query Test($cache: CacheID!, $rand: String!, $init: DirectoryID!) { container { from(address: "alpine:3.16.2") {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
withEnvVariable(name: "RAND", value: $rand) { withMountedCache(path: "/mnt/cache", cache: $cache, source: $init) { withExec(args: ["sh", "-c", "echo $RAND >> /mnt/cache/sub-file; cat /mnt/cache/sub-file"]) { stdout } } } } } }` rand1 := identity.NewID() err = testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "init": initialID, "rand": rand1, "cache": cacheID, }}) require.NoError(t, err) require.Equal(t, "initial-content\n"+rand1+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout) rand2 := identity.NewID() err = testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "init": initialID, "rand": rand2, "cache": cacheID, }}) require.NoError(t, err) require.Equal(t, "initial-content\n"+rand1+"\n"+rand2+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout) } func TestContainerWithMountedTemp(t *testing.T) { t.Parallel() execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedTemp struct { WithExec struct { Stdout string } } } } }{} err := testutil.Query(`{ container { from(address: "alpine:3.16.2") { withMountedTemp(path: "/mnt/tmp") { withExec(args: ["grep", "/mnt/tmp", "/proc/mounts"]) { stdout } } } } }`, &execRes, nil) require.NoError(t, err) require.Contains(t, execRes.Container.From.WithMountedTemp.WithExec.Stdout, "tmpfs /mnt/tmp tmpfs") } func TestContainerWithDirectory(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() dir := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content"). Directory("some-dir") ctr := c.Container(). From("alpine:3.16.2"). WithWorkdir("/workdir"). WithDirectory("with-dir", dir) contents, err := ctr.WithExec([]string{"cat", "with-dir/sub-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "sub-content", contents) contents, err = ctr.WithExec([]string{"cat", "/workdir/with-dir/sub-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "sub-content", contents)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
mount := c.Directory(). WithNewFile("mounted-file", "mounted-content") ctr = c.Container(). From("alpine:3.16.2"). WithWorkdir("/workdir"). WithMountedDirectory("mnt/mount", mount). WithDirectory("mnt/mount/dst/with-dir", dir) contents, err = ctr.WithExec([]string{"cat", "mnt/mount/mounted-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "mounted-content", contents) contents, err = ctr.WithExec([]string{"cat", "mnt/mount/dst/with-dir/sub-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "sub-content", contents) mnt := c.Directory().WithNewDirectory("/a/b/c") ctr = c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/mnt", mnt) dir = c.Directory(). WithNewDirectory("/foo"). WithNewFile("/foo/some-file", "some-content") ctr = ctr.WithDirectory("/mnt/a/b/foo", dir) contents, err = ctr.WithExec([]string{"cat", "/mnt/a/b/foo/foo/some-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "some-content", contents) } func TestContainerWithFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() file := c.Directory(). WithNewFile("some-file", "some-content"). File("some-file") ctr := c.Container(). From("alpine:3.16.2"). WithWorkdir("/workdir"). WithFile("target-file", file) contents, err := ctr.WithExec([]string{"cat", "target-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "some-content", contents) contents, err = ctr.WithExec([]string{"cat", "/workdir/target-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "some-content", contents) } func TestContainerWithNewFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() ctr := c.Container(). From("alpine:3.16.2"). WithWorkdir("/workdir"). WithNewFile("some-file", dagger.ContainerWithNewFileOpts{ Contents: "some-content", }) contents, err := ctr.WithExec([]string{"cat", "some-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "some-content", contents) contents, err = ctr.WithExec([]string{"cat", "/workdir/some-file"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "some-content", contents) } func TestContainerMountsWithoutMount(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { WithNewFile struct { WithNewFile struct { ID string } } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "sub-content") { id } } } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.WithNewFile.WithNewFile.ID execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithDirectory struct { WithMountedTemp struct { Mounts []string WithMountedDirectory struct { Mounts []string WithExec struct { Stdout string WithoutMount struct { Mounts []string WithExec struct { Stdout string } } } } } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
withDirectory(path: "/mnt/dir", directory: "") { withMountedTemp(path: "/mnt/tmp") { mounts withMountedDirectory(path: "/mnt/dir", source: $id) { mounts withExec(args: ["ls", "/mnt/dir"]) { stdout withoutMount(path: "/mnt/dir") { mounts withExec(args: ["ls", "/mnt/dir"]) { stdout } } } } } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.NoError(t, err) require.Equal(t, []string{"/mnt/tmp"}, execRes.Container.From.WithDirectory.WithMountedTemp.Mounts) require.Equal(t, []string{"/mnt/tmp", "/mnt/dir"}, execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.Mounts) require.Equal(t, "some-dir\nsome-file\n", execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.WithExec.Stdout) require.Equal(t, "", execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.WithExec.WithoutMount.WithExec.Stdout) require.Equal(t, []string{"/mnt/tmp"}, execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.WithExec.WithoutMount.Mounts) } func TestContainerReplacedMounts(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() lower := c.Directory().WithNewFile("some-file", "lower-content") upper := c.Directory().WithNewFile("some-file", "upper-content") ctr := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/mnt/dir", lower) t.Run("initial content is lower", func(t *testing.T) { mnts, err := ctr.Mounts(ctx) require.NoError(t, err) require.Equal(t, []string{"/mnt/dir"}, mnts) out, err := ctr.WithExec([]string{"cat", "/mnt/dir/some-file"}).Stdout(ctx) require.NoError(t, err) require.Equal(t, "lower-content", out) }) replaced := ctr.WithMountedDirectory("/mnt/dir", upper) t.Run("mounts of same path are replaced", func(t *testing.T) { mnts, err := replaced.Mounts(ctx) require.NoError(t, err) require.Equal(t, []string{"/mnt/dir"}, mnts) out, err := replaced.WithExec([]string{"cat", "/mnt/dir/some-file"}).Stdout(ctx) require.NoError(t, err) require.Equal(t, "upper-content", out) })
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Run("removing a replaced mount does not reveal previous mount", func(t *testing.T) { removed := replaced.WithoutMount("/mnt/dir") mnts, err := removed.Mounts(ctx) require.NoError(t, err) require.Empty(t, mnts) }) clobberedDir := c.Directory().WithNewFile("some-file", "clobbered-content") clobbered := replaced.WithMountedDirectory("/mnt", clobberedDir) t.Run("replacing parent of a mount clobbers child", func(t *testing.T) { mnts, err := clobbered.Mounts(ctx) require.NoError(t, err) require.Equal(t, []string{"/mnt"}, mnts) out, err := clobbered.WithExec([]string{"cat", "/mnt/some-file"}).Stdout(ctx) require.NoError(t, err) require.Equal(t, "clobbered-content", out) }) clobberedSubDir := c.Directory().WithNewFile("some-file", "clobbered-sub-content") clobberedSub := clobbered.WithMountedDirectory("/mnt/dir", clobberedSubDir) t.Run("restoring mount under clobbered mount", func(t *testing.T) { mnts, err := clobberedSub.Mounts(ctx) require.NoError(t, err) require.Equal(t, []string{"/mnt", "/mnt/dir"}, mnts) out, err := clobberedSub.WithExec([]string{"cat", "/mnt/dir/some-file"}).Stdout(ctx) require.NoError(t, err) require.Equal(t, "clobbered-sub-content", out) }) } func TestContainerDirectory(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { WithNewFile struct { WithNewFile struct { ID core.DirectoryID } } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "sub-content") { id } } } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.WithNewFile.WithNewFile.ID writeRes := struct { Container struct { From struct { WithMountedDirectory struct { WithMountedDirectory struct { WithExec struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { ID core.DirectoryID } } } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { withMountedDirectory(path: "/mnt/dir/overlap", source: $id) { withExec(args: ["sh", "-c", "echo hello >> /mnt/dir/overlap/another-file"]) { directory(path: "/mnt/dir/overlap") { id } } } } } } }`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.NoError(t, err) writtenID := writeRes.Container.From.WithMountedDirectory.WithMountedDirectory.WithExec.Directory.ID execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedDirectory struct { WithExec struct { Stdout string } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { withExec(args: ["cat", "/mnt/dir/another-file"]) { stdout } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": writtenID, }}) require.NoError(t, err) require.Equal(t, "hello\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout) } func TestContainerDirectoryErrors(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { WithNewFile struct { WithNewFile struct { ID core.DirectoryID } } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "sub-content") { id } } } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.WithNewFile.WithNewFile.ID err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { directory(path: "/mnt/dir/some-file") { id
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
} } } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.Error(t, err) require.Contains(t, err.Error(), "path /mnt/dir/some-file is a file, not a directory") err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { directory(path: "/mnt/dir/bogus") { id } } } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.Error(t, err) require.Contains(t, err.Error(), "bogus: no such file or directory") err = testutil.Query( `{ container { from(address: "alpine:3.16.2") { withMountedTemp(path: "/mnt/tmp") {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
directory(path: "/mnt/tmp/bogus") { id } } } } }`, nil, nil) require.Error(t, err) require.Contains(t, err.Error(), "bogus: cannot retrieve path from tmpfs") cacheID := newCache(t) err = testutil.Query( `query Test($cache: CacheID!) { container { from(address: "alpine:3.16.2") { withMountedCache(path: "/mnt/cache", cache: $cache) { directory(path: "/mnt/cache/bogus") { id } } } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "cache": cacheID, }}) require.Error(t, err) require.Contains(t, err.Error(), "bogus: cannot retrieve path from cache") } func TestContainerDirectorySourcePath(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { WithNewFile struct { Directory struct { ID core.DirectoryID } } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-dir/sub-dir/sub-file", contents: "sub-content\n") { directory(path: "some-dir") { id } } } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.WithNewFile.Directory.ID writeRes := struct { Container struct { From struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
WithMountedDirectory struct { WithExec struct { Directory struct { ID core.DirectoryID } } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { withExec(args: ["sh", "-c", "echo more-content >> /mnt/dir/sub-dir/sub-file"]) { directory(path: "/mnt/dir/sub-dir") { id } } } } } }`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.NoError(t, err) writtenID := writeRes.Container.From.WithMountedDirectory.WithExec.Directory.ID execRes := struct { Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
From struct { WithMountedDirectory struct { WithExec struct { Stdout string } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { withExec(args: ["cat", "/mnt/dir/sub-file"]) { stdout } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": writtenID, }}) require.NoError(t, err) require.Equal(t, "sub-content\nmore-content\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout) } func TestContainerFile(t *testing.T) { t.Parallel() id := newDirWithFile(t, "some-file", "some-content-") writeRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedDirectory struct { WithMountedDirectory struct { WithExec struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
File struct { ID core.FileID } } } } } } }{} err := testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { withMountedDirectory(path: "/mnt/dir/overlap", source: $id) { withExec(args: ["sh", "-c", "echo -n appended >> /mnt/dir/overlap/some-file"]) { file(path: "/mnt/dir/overlap/some-file") { id } } } } } } }`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.NoError(t, err) writtenID := writeRes.Container.From.WithMountedDirectory.WithMountedDirectory.WithExec.File.ID execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedFile struct { WithExec struct { Stdout string } } } } }{} err = testutil.Query( `query Test($id: FileID!) { container { from(address: "alpine:3.16.2") { withMountedFile(path: "/mnt/file", source: $id) { withExec(args: ["cat", "/mnt/file"]) { stdout } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": writtenID, }}) require.NoError(t, err) require.Equal(t, "some-content-appended", execRes.Container.From.WithMountedFile.WithExec.Stdout) } func TestContainerFileErrors(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() id := newDirWithFile(t, "some-file", "some-content") err := testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { file(path: "/mnt/dir/bogus") { id } } } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.Error(t, err) require.Contains(t, err.Error(), "bogus: no such file or directory") err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { file(path: "/mnt/dir") { id }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
} } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "id": id, }}) require.Error(t, err) require.Contains(t, err.Error(), "path /mnt/dir is a directory, not a file") err = testutil.Query( `{ container { from(address: "alpine:3.16.2") { withMountedTemp(path: "/mnt/tmp") { file(path: "/mnt/tmp/bogus") { id } } } } }`, nil, nil) require.Error(t, err) require.Contains(t, err.Error(), "bogus: cannot retrieve path from tmpfs") cacheID := newCache(t) err = testutil.Query( `query Test($cache: CacheID!) { container { from(address: "alpine:3.16.2") { withMountedCache(path: "/mnt/cache", cache: $cache) { file(path: "/mnt/cache/bogus") { id
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
} } } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "cache": cacheID, }}) require.Error(t, err) require.Contains(t, err.Error(), "bogus: cannot retrieve path from cache") secretID := newSecret(t, "some-secret") err = testutil.Query( `query Test($secret: SecretID!) { container { from(address: "alpine:3.16.2") { withMountedSecret(path: "/sekret", source: $secret) { file(path: "/sekret") { contents } } } } }`, nil, &testutil.QueryOptions{Variables: map[string]any{ "secret": secretID, }}) require.Error(t, err) require.Contains(t, err.Error(), "sekret: no such file or directory") } func TestContainerFSDirectory(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { Directory struct { ID core.DirectoryID } } } }{} err := testutil.Query( `{ container { from(address: "alpine:3.16.2") { directory(path: "/etc") { id } } } }`, &dirRes, nil) require.NoError(t, err) etcID := dirRes.Container.From.Directory.ID execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedDirectory struct { WithExec struct { Stdout string } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/etc", source: $id) { withExec(args: ["cat", "/mnt/etc/alpine-release"]) { stdout } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": etcID, }}) require.NoError(t, err) require.Equal(t, "3.16.2\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout) } func TestContainerRelativePaths(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { WithNewFile struct { ID core.DirectoryID } } }{} err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { id } } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.WithNewFile.ID writeRes := struct { Container struct { From struct { WithExec struct { WithWorkdir struct { WithWorkdir struct { Workdir string WithMountedDirectory struct { WithMountedTemp struct { WithMountedCache struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Mounts []string WithExec struct { Directory struct { ID core.DirectoryID } } WithoutMount struct { Mounts []string } } } } } } } } } }{} cacheID := newCache(t) err = testutil.Query( `query Test($id: DirectoryID!, $cache: CacheID!) { container { from(address: "alpine:3.16.2") { withExec(args: ["mkdir", "-p", "/mnt/sub"]) { withWorkdir(path: "/mnt") { withWorkdir(path: "sub") { workdir withMountedDirectory(path: "dir", source: $id) { withMountedTemp(path: "tmp") { withMountedCache(path: "cache", cache: $cache) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
mounts withExec(args: ["touch", "dir/another-file"]) { directory(path: "dir") { id } } withoutMount(path: "cache") { mounts } } } } } } } } } }`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{ "id": id, "cache": cacheID, }}) require.NoError(t, err) require.Equal(t, []string{"/mnt/sub/dir", "/mnt/sub/tmp", "/mnt/sub/cache"}, writeRes.Container.From.WithExec.WithWorkdir.WithWorkdir.WithMountedDirectory.WithMountedTemp.WithMountedCache.Mounts) require.Equal(t, []string{"/mnt/sub/dir", "/mnt/sub/tmp"}, writeRes.Container.From.WithExec.WithWorkdir.WithWorkdir.WithMountedDirectory.WithMountedTemp.WithMountedCache.WithoutMount.Mounts) writtenID := writeRes.Container.From.WithExec.WithWorkdir.WithWorkdir.WithMountedDirectory.WithMountedTemp.WithMountedCache.WithExec.Directory.ID execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedDirectory struct { WithExec struct { Stdout string } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "alpine:3.16.2") { withMountedDirectory(path: "/mnt/dir", source: $id) { withExec(args: ["ls", "/mnt/dir"]) { stdout } } } } }`, &execRes, &testutil.QueryOptions{Variables: map[string]any{ "id": writtenID, }}) require.NoError(t, err) require.Equal(t, "another-file\nsome-file\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout) } func TestContainerMultiFrom(t *testing.T) { t.Parallel() dirRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Directory struct { ID core.DirectoryID } }{} err := testutil.Query( `{ directory { id } }`, &dirRes, nil) require.NoError(t, err) id := dirRes.Directory.ID execRes := struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
Container struct { From struct { WithMountedDirectory struct { WithExec struct { From struct { WithExec struct { WithExec struct { Stdout string } } } } } } } }{} err = testutil.Query( `query Test($id: DirectoryID!) { container { from(address: "node:18.10.0-alpine") { withMountedDirectory(path: "/mnt", source: $id) { withExec(args: ["sh", "-c", "node --version >> /mnt/versions"]) { from(address: "golang:1.18.2-alpine") { withExec(args: ["sh", "-c", "go version >> /mnt/versions"]) { withExec(args: ["cat", "/mnt/versions"]) { stdout } } } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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.WithExec.From.WithExec.WithExec.Stdout, "v18.10.0\n") require.Contains(t, execRes.Container.From.WithMountedDirectory.WithExec.From.WithExec.WithExec.Stdout, "go version go1.18.2") } func TestContainerPublish(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() startRegistry(ctx, c, t) testRef := "127.0.0.1:5000/testimagepush:latest" pushedRef, err := c.Container(). From("alpine:3.16.2"). Publish(ctx, testRef) require.NoError(t, err) require.NotEqual(t, testRef, pushedRef) require.Contains(t, pushedRef, "@sha256:") contents, err := c.Container(). From(pushedRef).Rootfs().File("/etc/alpine-release").Contents(ctx) require.NoError(t, err) require.Equal(t, contents, "3.16.2\n") } func TestExecFromScratch(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
ctx, cancel := context.WithCancel(context.Background()) defer cancel() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() startRegistry(ctx, c, t) execBusybox := c.Container(). WithMountedFile("/busybox", c.Container().From("busybox:musl").File("/bin/busybox")). WithExec([]string{"/busybox"}) _, err = execBusybox.Stdout(ctx) require.NoError(t, err) _, err = execBusybox.Publish(ctx, "127.0.0.1:5000/testexecfromscratch:latest") require.NoError(t, err) } func TestContainerMultipleMounts(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
c, ctx := connect(t) defer c.Close() dir := t.TempDir() require.NoError(t, os.WriteFile(filepath.Join(dir, "one"), []byte("1"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "two"), []byte("2"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "three"), []byte("3"), 0600)) one := c.Host().Directory(dir).File("one") two := c.Host().Directory(dir).File("two") three := c.Host().Directory(dir).File("three") build := c.Container().From("alpine:3.16.2"). WithMountedFile("/example/one", one). WithMountedFile("/example/two", two). WithMountedFile("/example/three", three) build = build.WithExec([]string{"ls", "/example/one", "/example/two", "/example/three"}) build = build.WithExec([]string{"cat", "/example/one", "/example/two", "/example/three"}) out, err := build.Stdout(ctx) require.NoError(t, err) require.Equal(t, "123", out) } func TestContainerExport(t *testing.T) { t.Parallel() ctx := context.Background() wd := t.TempDir() dest := t.TempDir() c, err := dagger.Connect(ctx, dagger.WithWorkdir(wd)) require.NoError(t, err)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
defer c.Close() ctr := c.Container().From("alpine:3.16.2") t.Run("to absolute dir", func(t *testing.T) { imagePath := filepath.Join(dest, "image.tar") ok, err := ctr.Export(ctx, imagePath) require.NoError(t, err) require.True(t, ok) entries := tarEntries(t, imagePath) require.Contains(t, entries, "oci-layout") require.Contains(t, entries, "index.json") require.Contains(t, entries, "manifest.json") }) t.Run("to workdir", func(t *testing.T) { ok, err := ctr.Export(ctx, "./image.tar") require.NoError(t, err) require.True(t, ok) entries := tarEntries(t, filepath.Join(wd, "image.tar")) require.Contains(t, entries, "oci-layout") require.Contains(t, entries, "index.json") require.Contains(t, entries, "manifest.json") }) t.Run("to outer dir", func(t *testing.T) { ok, err := ctr.Export(ctx, "../") require.Error(t, err) require.False(t, ok) }) } func TestContainerMultiPlatformExport(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
ctx, cancel := context.WithCancel(context.Background()) defer cancel() c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout)) require.NoError(t, err) defer c.Close() startRegistry(ctx, c, t) variants := make([]*dagger.Container, 0, len(platformToUname)) for platform := range platformToUname { ctr := c.Container(dagger.ContainerOpts{Platform: platform}). From("alpine:3.16.2"). WithExec([]string{"uname", "-m"}) variants = append(variants, ctr) } dest := filepath.Join(t.TempDir(), "image.tar") ok, err := c.Container().Export(ctx, dest, dagger.ContainerExportOpts{ PlatformVariants: variants, }) require.NoError(t, err) require.True(t, ok) entries := tarEntries(t, dest) require.Contains(t, entries, "oci-layout") require.Contains(t, entries, "index.json") require.NotContains(t, entries, "manifest.json") } func TestContainerWithDirectoryToMount(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout)) require.NoError(t, err) defer c.Close() mnt := c.Directory(). WithNewDirectory("/top/sub-dir/sub-file"). Directory("/top") ctr := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/mnt", mnt) dir := c.Directory(). WithNewFile("/copied-file", "some-content") ctr = ctr.WithDirectory("/mnt/sub-dir/copied-dir", dir) contents, err := ctr.WithExec([]string{"find", "/mnt"}).Stdout(ctx) require.NoError(t, err) require.Equal(t, []string{ "/mnt", "/mnt/sub-dir", "/mnt/sub-dir/sub-file", "/mnt/sub-dir/copied-dir", "/mnt/sub-dir/copied-dir/copied-file", }, strings.Split(strings.Trim(contents, "\n"), "\n")) } var echoSocketSrc string func TestContainerWithUnixSocket(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout)) require.NoError(t, err) tmp := t.TempDir() sock := filepath.Join(tmp, "test.sock") l, err := net.Listen("unix", sock) require.NoError(t, err) defer l.Close() go func() { for { c, err := l.Accept() if err != nil { if !errors.Is(err, net.ErrClosed) { t.Logf("accept: %s", err) panic(err) } return } n, err := io.Copy(c, c) if err != nil { t.Logf("hello: %s", err) panic(err) } t.Logf("copied %d bytes", n) err = c.Close() if err != nil { t.Logf("close: %s", err) panic(err) } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
}() echo := c.Directory().WithNewFile("main.go", echoSocketSrc).File("main.go") ctr := c.Container(). From("golang:1.18.2-alpine"). WithMountedFile("/src/main.go", echo). WithUnixSocket("/tmp/test.sock", c.Host().UnixSocket(sock)). WithExec([]string{"go", "run", "/src/main.go", "/tmp/test.sock", "hello"}) stdout, err := ctr.Stdout(ctx) require.NoError(t, err) require.Equal(t, "hello\n", stdout) t.Run("socket can be removed", func(t *testing.T) { without := ctr.WithoutUnixSocket("/tmp/test.sock"). WithExec([]string{"ls", "/tmp"}) stdout, err = without.Stdout(ctx) require.NoError(t, err) require.Empty(t, stdout) }) t.Run("replaces existing socket at same path", func(t *testing.T) { repeated := ctr.WithUnixSocket("/tmp/test.sock", c.Host().UnixSocket(sock)) stdout, err := repeated.Stdout(ctx) require.NoError(t, err) require.Equal(t, "hello\n", stdout) without := repeated.WithoutUnixSocket("/tmp/test.sock"). WithExec([]string{"ls", "/tmp"}) stdout, err = without.Stdout(ctx) require.NoError(t, err) require.Empty(t, stdout) }) } func TestContainerExecError(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Parallel() ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout)) require.NoError(t, err) outMsg := "THIS SHOULD GO TO STDOUT" encodedOutMsg := base64.StdEncoding.EncodeToString([]byte(outMsg)) errMsg := "THIS SHOULD GO TO STDERR" encodedErrMsg := base64.StdEncoding.EncodeToString([]byte(errMsg))
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/integration/container_test.go
t.Run("includes output of failed exec in error", func(t *testing.T) { _, err = c.Container(). From("alpine:3.16.2"). WithExec([]string{"sh", "-c", fmt.Sprintf( `echo %s | base64 -d >&1; echo %s | base64 -d >&2; exit 1`, encodedOutMsg, encodedErrMsg, )}). ExitCode(ctx) require.Error(t, err) require.Contains(t, err.Error(), outMsg) require.Contains(t, err.Error(), errMsg) }) t.Run("includes output of failed exec in error when redirects are enabled", func(t *testing.T) { _, err = c.Container(). From("alpine:3.16.2"). WithExec( []string{"sh", "-c", fmt.Sprintf( `echo %s | base64 -d >&1; echo %s | base64 -d >&2; exit 1`, encodedOutMsg, encodedErrMsg, )}, dagger.ContainerWithExecOpts{ RedirectStdout: "/out", RedirectStderr: "/err", }, ). ExitCode(ctx) require.Error(t, err) require.Contains(t, err.Error(), outMsg) require.Contains(t, err.Error(), errMsg) }) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
package schema import ( "fmt" "path" "strings" "github.com/dagger/dagger/core" "github.com/dagger/dagger/router" specs "github.com/opencontainers/image-spec/specs-go/v1" ) type containerSchema struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
*baseSchema host *core.Host } 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("")), "Query": router.ObjectResolver{ "container": router.ToResolver(s.container), }, "Container": router.ObjectResolver{ "from": router.ToResolver(s.from), "build": router.ToResolver(s.build), "rootfs": router.ToResolver(s.rootfs), "pipeline": router.ToResolver(s.pipeline), "fs": router.ToResolver(s.rootfs), "withRootfs": router.ToResolver(s.withRootfs), "withFS": router.ToResolver(s.withRootfs), "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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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), "withUnixSocket": router.ToResolver(s.withUnixSocket), "withoutUnixSocket": router.ToResolver(s.withoutUnixSocket), "withoutMount": router.ToResolver(s.withoutMount), "withFile": router.ToResolver(s.withFile), "withNewFile": router.ToResolver(s.withNewFile), "withDirectory": router.ToResolver(s.withDirectory), "withExec": router.ToResolver(s.withExec), "exec": router.ToResolver(s.withExec), "exitCode": router.ToResolver(s.exitCode), "stdout": router.ToResolver(s.stdout), "stderr": router.ToResolver(s.stderr), "publish": router.ToResolver(s.publish), "platform": router.ToResolver(s.platform),
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
"export": router.ToResolver(s.export), }, } } func (s *containerSchema) Dependencies() []router.ExecutableSchema { return nil } type containerArgs struct { ID core.ContainerID Platform *specs.Platform } func (s *containerSchema) container(ctx *router.Context, parent *core.Query, args containerArgs) (*core.Container, error) { platform := s.baseSchema.platform if args.Platform != nil { if args.ID != "" { return nil, fmt.Errorf("cannot specify both existing container ID and platform") } platform = *args.Platform } pipeline := core.PipelinePath{} if parent != nil { pipeline = parent.Context.Pipeline } ctr, err := core.NewContainer(args.ID, pipeline, platform) if err != nil { return nil, err } return ctr, err } type containerFromArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
Address string } func (s *containerSchema) from(ctx *router.Context, parent *core.Container, args containerFromArgs) (*core.Container, error) { return parent.From(ctx, s.gw, args.Address) } type containerBuildArgs struct { Context core.DirectoryID Dockerfile string BuildArgs []core.BuildArg Target 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, args.BuildArgs, args.Target) } func (s *containerSchema) withRootfs(ctx *router.Context, parent *core.Container, arg core.Directory) (*core.Container, error) { ctr, err := parent.WithRootFS(ctx, &arg) if err != nil { return nil, err } return ctr, nil } type containerPipelineArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
Name string Description string } func (s *containerSchema) pipeline(ctx *router.Context, parent *core.Container, args containerPipelineArgs) (*core.Container, error) { return parent.Pipeline(ctx, args.Name, args.Description) } func (s *containerSchema) rootfs(ctx *router.Context, parent *core.Container, args any) (*core.Directory, error) { return parent.RootFS(ctx) } type containerExecArgs struct { core.ContainerExecOpts } func (s *containerSchema) withExec(ctx *router.Context, parent *core.Container, args containerExecArgs) (*core.Container, error) { return parent.Exec(ctx, s.gw, s.baseSchema.platform, 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) (*string, error) { return parent.MetaFileContents(ctx, s.gw, "stdout") } func (s *containerSchema) stderr(ctx *router.Context, parent *core.Container, args any) (*string, error) { return parent.MetaFileContents(ctx, s.gw, "stderr") } type containerWithEntrypointArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
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 { Address string PlatformVariants []core.ContainerID } func (s *containerSchema) publish(ctx *router.Context, parent *core.Container, args containerPublishArgs) (string, error) { return parent.Publish(ctx, args.Address, args.PlatformVariants, s.bkClient, s.solveOpts, s.solveCh) } type containerWithMountedFileArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
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 { 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 {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
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 { 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 {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
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)) } func (s *containerSchema) withDirectory(ctx *router.Context, parent *core.Container, args withDirectoryArgs) (*core.Container, error) { return parent.WithDirectory(ctx, s.gw, args.Path, &core.Directory{ID: args.Directory}, args.CopyFilter) } func (s *containerSchema) withFile(ctx *router.Context, parent *core.Container, args withFileArgs) (*core.Container, error) { return parent.WithFile(ctx, s.gw, args.Path, &core.File{ID: args.Source}, args.Permissions) } func (s *containerSchema) withNewFile(ctx *router.Context, parent *core.Container, args withNewFileArgs) (*core.Container, error) { return parent.WithNewFile(ctx, s.gw, args.Path, []byte(args.Contents), args.Permissions) } type containerWithUnixSocketArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
core/schema/container.go
Path string Source core.SocketID } func (s *containerSchema) withUnixSocket(ctx *router.Context, parent *core.Container, args containerWithUnixSocketArgs) (*core.Container, error) { return parent.WithUnixSocket(ctx, args.Path, core.NewSocket(args.Source)) } type containerWithoutUnixSocketArgs struct { Path string } func (s *containerSchema) withoutUnixSocket(ctx *router.Context, parent *core.Container, args containerWithoutUnixSocketArgs) (*core.Container, error) { return parent.WithoutUnixSocket(ctx, args.Path) } func (s *containerSchema) platform(ctx *router.Context, parent *core.Container, args any) (specs.Platform, error) { return parent.Platform() } type containerExportArgs struct { Path string PlatformVariants []core.ContainerID } func (s *containerSchema) export(ctx *router.Context, parent *core.Container, args containerExportArgs) (bool, error) { if err := parent.Export(ctx, s.host, args.Path, args.PlatformVariants, s.bkClient, s.solveOpts, s.solveCh); err != nil { return false, err } return true, nil }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
package dagger import ( "context" "dagger.io/dagger/internal/querybuilder" "github.com/Khan/genqlient/graphql" ) type CacheID string type ContainerID string type DirectoryID string type FileID string type Platform string type SecretID string type SocketID string type BuildArg struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Name string `json:"name"` Value string `json:"value"` } 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) XXX_GraphQLType() string { return "CacheVolume" } func (r *CacheVolume) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } type Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } type ContainerBuildOpts struct { Dockerfile string BuildArgs []BuildArg Target string } func (r *Container) Build(context *Directory, opts ...ContainerBuildOpts) *Container { q := r.q.Select("build") q = q.Arg("context", context)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Dockerfile) { q = q.Arg("dockerfile", opts[i].Dockerfile) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].BuildArgs) { q = q.Arg("buildArgs", opts[i].BuildArgs) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Target) { q = q.Arg("target", opts[i].Target) 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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Args []string Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool } 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].Stdin) { q = q.Arg("stdin", opts[i].Stdin) break } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStdout) { q = q.Arg("redirectStdout", opts[i].RedirectStdout) 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].ExperimentalPrivilegedNesting) { q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting) 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)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
} type ContainerExportOpts struct { PlatformVariants []*Container } func (r *Container) Export(ctx context.Context, path string, opts ...ContainerExportOpts) (bool, error) { q := r.q.Select("export") q = q.Arg("path", path) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].PlatformVariants) { q = q.Arg("platformVariants", opts[i].PlatformVariants) break } } var response bool 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 string) *Container { q := r.q.Select("from")
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
q = q.Arg("address", address) return &Container{ q: q, 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) XXX_GraphQLType() string { return "Container" } func (r *Container) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *Container) Mounts(ctx context.Context) ([]string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
q := r.q.Select("mounts") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerPipelineOpts struct { Description string } func (r *Container) Pipeline(name string, opts ...ContainerPipelineOpts) *Container { q := r.q.Select("pipeline") q = q.Arg("name", name) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Description) { q = q.Arg("description", opts[i].Description) break } } return &Container{ q: q, c: r.c, } } func (r *Container) Platform(ctx context.Context) (Platform, error) { q := r.q.Select("platform") var response Platform q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerPublishOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
PlatformVariants []*Container } func (r *Container) Publish(ctx context.Context, address string, opts ...ContainerPublishOpts) (string, error) { q := r.q.Select("publish") q = q.Arg("address", address) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].PlatformVariants) { q = q.Arg("platformVariants", opts[i].PlatformVariants) break } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Rootfs() *Directory { q := r.q.Select("rootfs") return &Directory{ q: q, c: r.c, } } func (r *Container) Stderr(ctx context.Context) (string, error) { q := r.q.Select("stderr") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Stdout(ctx context.Context) (string, error) { q := r.q.Select("stdout") var response string q = q.Bind(&response) return response, q.Execute(ctx, 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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/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, } } type ContainerWithDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Exclude []string Include []string } func (r *Container) WithDirectory(path string, directory *Directory, opts ...ContainerWithDirectoryOpts) *Container { q := r.q.Select("withDirectory") q = q.Arg("path", path) q = q.Arg("directory", directory) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) break } }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) 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, } } 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, } } type ContainerWithExecOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool } func (r *Container) WithExec(args []string, opts ...ContainerWithExecOpts) *Container { q := r.q.Select("withExec") q = q.Arg("args", args) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Stdin) { q = q.Arg("stdin", opts[i].Stdin) 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,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
} } 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].ExperimentalPrivilegedNesting) { q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithFS(id *Directory) *Container { q := r.q.Select("withFS") q = q.Arg("id", id) return &Container{ q: q, c: r.c, } } type ContainerWithFileOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Permissions int } func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container { q := r.q.Select("withFile") q = q.Arg("path", path) q = q.Arg("source", source) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) break } } return &Container{ q: q, c: r.c, } } type ContainerWithMountedCacheOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Source *Directory } func (r *Container) WithMountedCache(path string, cache *CacheVolume, opts ...ContainerWithMountedCacheOpts) *Container { q := r.q.Select("withMountedCache") q = q.Arg("path", path) q = q.Arg("cache", cache) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Source) { q = q.Arg("source", opts[i].Source) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedDirectory(path string, source *Directory) *Container { q := r.q.Select("withMountedDirectory") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
c: r.c, } } func (r *Container) WithMountedFile(path string, source *File) *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 *Secret) *Container { q := r.q.Select("withMountedSecret") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ 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, } } type ContainerWithNewFileOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Contents string Permissions int } func (r *Container) WithNewFile(path string, opts ...ContainerWithNewFileOpts) *Container { q := r.q.Select("withNewFile") q = q.Arg("path", path) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Contents) { q = q.Arg("contents", opts[i].Contents) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithRootfs(id *Directory) *Container { q := r.q.Select("withRootfs") q = q.Arg("id", id)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
return &Container{ q: q, c: r.c, } } func (r *Container) WithSecretVariable(name string, secret *Secret) *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) WithUnixSocket(path string, source *Socket) *Container { q := r.q.Select("withUnixSocket") q = q.Arg("path", path) q = q.Arg("source", source) 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, }
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
} func (r *Container) WithWorkdir(path string) *Container { 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) WithoutUnixSocket(path string) *Container { q := r.q.Select("withoutUnixSocket") q = q.Arg("path", path) return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
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 { q *querybuilder.Selection c graphql.Client } func (r *Directory) Diff(other *Directory) *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 DirectoryDockerBuildOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Dockerfile string Platform Platform BuildArgs []BuildArg Target string } func (r *Directory) DockerBuild(opts ...DirectoryDockerBuildOpts) *Container { q := r.q.Select("dockerBuild") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Dockerfile) { q = q.Arg("dockerfile", opts[i].Dockerfile)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Platform) { q = q.Arg("platform", opts[i].Platform) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].BuildArgs) { q = q.Arg("buildArgs", opts[i].BuildArgs) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Target) { q = q.Arg("target", opts[i].Target) break } } return &Container{ q: q, c: r.c, } } type DirectoryEntriesOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/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) Export(ctx context.Context, path string) (bool, error) { q := r.q.Select("export") q = q.Arg("path", path) var response bool 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)
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
return &File{ q: q, c: r.c, } } func (r *Directory) ID(ctx context.Context) (DirectoryID, error) { q := r.q.Select("id") var response DirectoryID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) XXX_GraphQLType() string { return "Directory" } func (r *Directory) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(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, } } type DirectoryPipelineOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Description string } func (r *Directory) Pipeline(name string, opts ...DirectoryPipelineOpts) *Directory { q := r.q.Select("pipeline") q = q.Arg("name", name) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Description) { q = q.Arg("description", opts[i].Description) break } } return &Directory{ q: q, c: r.c, } } type DirectoryWithDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Exclude []string Include []string } func (r *Directory) WithDirectory(path string, directory *Directory, opts ...DirectoryWithDirectoryOpts) *Directory { q := r.q.Select("withDirectory") q = q.Arg("path", path) q = q.Arg("directory", directory) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) break } } for i := len(opts) - 1; i >= 0; i-- {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) break } } return &Directory{ q: q, c: r.c, } } type DirectoryWithFileOpts struct { Permissions int } func (r *Directory) WithFile(path string, source *File, opts ...DirectoryWithFileOpts) *Directory { q := r.q.Select("withFile") q = q.Arg("path", path) q = q.Arg("source", source) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) break } } return &Directory{ q: q, c: r.c, } } type DirectoryWithNewDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,887
✨ Ability to add LABELs to Docker images published via SDK
### What are you trying to do? Generate and publish a docker image which has LABELs. Related discussion : https://discord.com/channels/707636530424053791/1042501877906022481 ### Why is this important to you? We have corporate policies that mandate certain labels on all docker images ### How are you currently working around this? The workaround is to manually create a dockerfile with the LABELs added. But this is inconvenient and bypasses the features provided by the API and SDK For broader set of OCI configs: #3886
https://github.com/dagger/dagger/issues/3887
https://github.com/dagger/dagger/pull/4387
c5c5e0e3a51b6a80eee69f07b24aec36ae99cc13
e24ce91f30cec5ad7f35f975c46f34969ad3bae3
2022-11-17T05:20:38Z
go
2023-01-19T18:15:20Z
sdk/go/api.gen.go
Permissions int } func (r *Directory) WithNewDirectory(path string, opts ...DirectoryWithNewDirectoryOpts) *Directory { q := r.q.Select("withNewDirectory") q = q.Arg("path", path) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) break } } return &Directory{ q: q, c: r.c, } } type DirectoryWithNewFileOpts struct {