#Is there a predefined way to get the OS of the container ?

1 messages · Page 1 of 1 (latest)

light yarrow
#

In order to exec the right installation command i wonder if there is a predefined way to know if it's an alpine, ubuntu, ... container.
I can work on an extract of /etc/os-release but i find it a more hackish way to do it.

chilly tulip
# light yarrow In order to exec the right installation command i wonder if there is a predefine...

unfortunately there's not. We do this ourselves the engine to automatically provision certificates and we're checking /etc/ files as well. ref: https://github.com/dagger/dagger/blob/main/engine/buildkit/cacerts/distros.go

GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

light yarrow
#

Thank's for the link ! i'll look into it !

chilly tulip
light yarrow
# chilly tulip sure, np! let us know if you find a better way! 😛

In the Fedora module there is something on grabbing the version from labels, : https://github.com/scottames/daggerverse/blob/2448fda9ede3eb2d134587fe05b00dc9a09082a9/fedora/container.go

Maybe a module adding a set of labels on a container based on container Os exploration would provide a nice way to extract this "complexity" and build on it

GitHub

My collection of the Daggerverse. Contribute to scottames/daggerverse development by creating an account on GitHub.