Updated to image thwich can handle musl
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kasper Juul Hermansen 2022-11-06 01:11:45 +01:00
parent 4e10b5c543
commit 9c8a3719ce
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
3 changed files with 22 additions and 14 deletions

View File

@ -41,7 +41,27 @@ func (p *Pipeline) WithRustBin(opts *RustBinOpts) *Pipeline {
c := container.LoadImage(client, "harbor.server.kjuulh.io/docker-proxy/library/rust:buster")
c = c.Exec(dagger.ContainerExecOpts{
Args: []string{
"apt install musl-tools",
"apt", "update", "-y",
},
})
if _, err := c.ExitCode(ctx); err != nil {
return err
}
c = c.Exec(dagger.ContainerExecOpts{
Args: []string{
"apt", "install", "musl-tools", "-y",
},
})
if _, err := c.ExitCode(ctx); err != nil {
return err
}
c = c.Exec(dagger.ContainerExecOpts{
Args: []string{
"rustup",
"target",
"add",
"x86_64-unknown-linux-musl",
},
})
if _, err := c.ExitCode(ctx); err != nil {

View File

@ -11,18 +11,6 @@ import (
func Build(ctx context.Context, container *dagger.Container, binName string) (dagger.FileID, error) {
log.Printf("building binary: (binName=%s)", binName)
c := container.Exec(dagger.ContainerExecOpts{
Args: []string{
"rustup",
"target",
"add",
"x86_64-unknown-linux-musl",
},
})
if _, err := c.ExitCode(ctx); err != nil {
return "", err
}
c = c.Exec(dagger.ContainerExecOpts{
Args: []string{
"cargo",
"build",

View File

@ -4,7 +4,7 @@ name: "drone-dagger-test"
steps:
- name: "build"
image: harbor.server.kjuulh.io/kjuulh/bust:1667692696139
image: harbor.server.kjuulh.io/kjuulh/bust:166769342945
volumes:
- name: dockersock
path: /var/run