trying to just mount instead

This commit is contained in:
Kasper Juul Hermansen 2022-10-30 22:27:04 +01:00
parent 98a08fc3ef
commit 0376578c61
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
3 changed files with 6 additions and 12 deletions

View File

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

View File

@ -57,6 +57,8 @@ git.front.kjuulh.io/kjuulh/dagger-go v0.0.18 h1:asW/jEmf3HORb6nqgUldoLge/UjEFFnI
git.front.kjuulh.io/kjuulh/dagger-go v0.0.18/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.19 h1:IgpZ1X5ZDYl/byBSife1wXTBmFHNvHwf1MLw8AZ29R4=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.19/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.20 h1:iw/gnsaGe4SzqbRT6i14LPvu/Cpbe7XiCpnqFfkTLA8=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.20/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
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/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=

View File

@ -73,18 +73,10 @@ func (p *Pipeline) WithGolangBin(opts *GolangBinOpts) *Pipeline {
if opts.BaseImage == "" {
opts.BaseImage = "harbor.front.kjuulh.io/docker-proxy/library/busybox"
}
c := container.LoadImage(client, opts.BaseImage)
c = c.Exec(dagger.ContainerExecOpts{
Args: []string{"mkdir", "-p", "/tmp/bin/", "/usr/bin/"},
})
tempmount := fmt.Sprintf("/tmp/bin/%s", opts.BinName)
usrbin := fmt.Sprintf("/usr/bin/%s", opts.BinName)
c = container.MountFileFromLoaded(c, bin, tempmount)
c = c.Exec(dagger.ContainerExecOpts{
Args: []string{
"cp", tempmount, opts.BinName,
},
})
c := container.LoadImage(client, opts.BaseImage)
c = container.MountFileFromLoaded(c, bin, usrbin)
finalImage = c.WithEntrypoint([]string{usrbin})
return nil