#How would I do the following on the dagger CLI?

1 messages · Page 1 of 1 (latest)

fickle mauve
#
dag.k3S(name)
  .with(k3s => k3s.withContainer(
    k3s.container()
      .withMountedFile('/etc/ssl/certs/custom-ca.crt', customCaFile)
  ))
  .server()

e.g.

dagger -m github.com/marcosnils/daggerverse/k3s@v0.1.8 call --name "test" with-container ...
tulip ocean
#

You cannot do this with dagger call but you can do it with dagger shell

k3s | with $(with-container $(container | with-mounted-file <path>) | server

Something like that

You can learn more about shell syntax here:

fickle mauve
#

Cool thanks ❤️

#

@tulip ocean weird it can't find the with method on the K3S type?

k3s test | with $(with-container $(container | with-mounted-file /etc/ssl/certs/custom-ca.crt .devcontainer/custom-ca.crt)) | server 0.0s
! no function "with" in type "K3S"
tulip ocean
fickle mauve
#

That's passing test into the K3s function

tulip ocean
#

Ohhh

fickle mauve
#

Like dag.k3S('test')

tulip ocean
#

Maybe you can try k3s test | .help to see available functions

fickle mauve
#

Yeah weird it's not documented

#

I think this is what I wanted.

k3s test | with-container $(k3s test | container | with-mounted-file /etc/ssl/certs/custom-ca.crt $(host | file .devcontainer/custom-ca.crt)) | server | up