Manage packages using the package manager
This documentation is for an older version of Dagger, which is no longer actively maintained.
We encourage you to upgrade and refer to the documentation for the most current version.
If you cannot upgrade to the latest version, please contact us in the help forum on Discord. When contacting us, please let us know why you cannot move to the latest version. From there, our team will work with you on your use case.
This tutorial illustrates how to install and upgrade packages using Dagger package manager.
Installing a package
Create an empty directory for your new Dagger project:
As described in the previous tutorials, initialize your Dagger project:
dagger new test
That will create 2 directories:
cue.mod where our package will reside:
│ ├── module.cue
│ ├── pkg
│ └── usr
│ └── env
│ └── test
In our example we will use
gcpcloudrun package from github
Let's first add it to our
To install it just run
dagger mod get email@example.com
It should pull the
v0.1 version from GitHub, leave a copy in
cue.mod/pkg and reflect the change in
Querying the current setup with
dagger query should return a valid result:
Now that you've successfully installed a package, let's try to upgrade it.
dagger mod get firstname.lastname@example.org
You should see similar output:
12:25PM INF system | downloading github.com/dagger/packages:v0.2
cue.mod/dagger.mod should reflect the new version:
Develop package locally
Currently, package manager cannot add local packages so a workaround is linking the package to
Create a directory with your domain name, usually github.com/myuser, and link your package directory.
ln -s <localpackage> cue.mod/pkg/<mydomain>/<mypackagename>