with debug

This commit is contained in:
Kasper Juul Hermansen 2022-10-30 21:25:14 +01:00
parent 8099d55ce9
commit a24a7bdeca
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
4 changed files with 10 additions and 13 deletions

View File

@ -2,7 +2,7 @@ module ci
go 1.19 go 1.19
require git.front.kjuulh.io/kjuulh/dagger-go v0.0.10 require git.front.kjuulh.io/kjuulh/dagger-go v0.0.11
require ( require (
dagger.io/dagger v0.3.1 // indirect dagger.io/dagger v0.3.1 // indirect

View File

@ -43,6 +43,8 @@ git.front.kjuulh.io/kjuulh/dagger-go v0.0.9 h1:XxKhvUM8q7QcRSTeE7hF56zoXKGOncdHB
git.front.kjuulh.io/kjuulh/dagger-go v0.0.9/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8= git.front.kjuulh.io/kjuulh/dagger-go v0.0.9/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.10 h1:d9VNhI6OsiR/W4/1iJvchuHwTq2C3AHw3yetncKWfUM= git.front.kjuulh.io/kjuulh/dagger-go v0.0.10 h1:d9VNhI6OsiR/W4/1iJvchuHwTq2C3AHw3yetncKWfUM=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.10/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8= git.front.kjuulh.io/kjuulh/dagger-go v0.0.10/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.11 h1:j3ylHiGmhcFomggJcrNJghbYBK/nuuvw0naFBIWqEqo=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.11/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
github.com/99designs/gqlgen v0.17.2/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o= github.com/99designs/gqlgen v0.17.2/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=

BIN
main Executable file

Binary file not shown.

View File

@ -35,7 +35,6 @@ func (p *Pipeline) WithGolangBin(opts *GolangBinOpts) *Pipeline {
var ( var (
bin dagger.FileID bin dagger.FileID
build *dagger.Container build *dagger.Container
scratch *dagger.Container
finalImage *dagger.Container finalImage *dagger.Container
) )
@ -66,24 +65,20 @@ func (p *Pipeline) WithGolangBin(opts *GolangBinOpts) *Pipeline {
return err return err
}, },
}, },
byg.Step{
Execute: func(ctx byg.Context) error {
if opts.BaseImage == "" {
opts.BaseImage = "harbor.front.kjuulh.io/docker-proxy/library/busybox"
}
scratch = container.LoadImage(client, opts.BaseImage)
return nil
},
},
). ).
Step( Step(
"create-production-image", "create-production-image",
byg.Step{ byg.Step{
Execute: func(ctx byg.Context) error { Execute: func(ctx byg.Context) error {
if opts.BaseImage == "" {
opts.BaseImage = "harbor.front.kjuulh.io/docker-proxy/library/busybox"
}
c := container.LoadImage(client, opts.BaseImage)
tempmount := fmt.Sprintf("/tmp/%s", opts.BinName) tempmount := fmt.Sprintf("/tmp/%s", opts.BinName)
usrbin := fmt.Sprintf("/bin/%s", opts.BinName) usrbin := fmt.Sprintf("/bin/%s", opts.BinName)
c := container.MountFileFromLoaded(scratch, bin, tempmount) log.Printf("binname: %s", bin)
c = container.MountFileFromLoaded(c, bin, tempmount)
c = c.Exec(dagger.ContainerExecOpts{ c = c.Exec(dagger.ContainerExecOpts{
Args: []string{"cp", tempmount, usrbin}, Args: []string{"cp", tempmount, usrbin},
}) })