build
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73aEntrypoint
Return Type
Build Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
func (m *MyModule) Example() *dagger.Build {
return dag.
Build()
}@function
def example() -> dagger.Build:
return (
dag.build()
)@func()
example(): Build {
return dag
.build()
}Types
Build 🔗
buildDocker() 🔗
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| jobAttempt | String | - | No description provided |
| repository | String ! | - | No description provided |
| ref | String | - | No description provided |
| path | String | - | No description provided |
| job | String | - | No description provided |
| framework | String ! | - | No description provided |
| packageManager | String | - | No description provided |
| exposedPort | Integer | - | No description provided |
Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
build-docker --repository string --framework stringfunc (m *MyModule) Example(repository string, framework string) *dagger.Container {
return dag.
Build().
BuildDocker(repository, framework)
}@function
def example(repository: str, framework: str) -> dagger.Container:
return (
dag.build()
.build_docker(repository, framework)
)@func()
example(repository: string, framework: string): Container {
return dag
.build()
.buildDocker(repository, framework)
}buildNext() 🔗
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| jobAttempt | String | - | No description provided |
| repository | String ! | - | No description provided |
| ref | String | - | No description provided |
| path | String | - | No description provided |
| job | String | - | No description provided |
| framework | String ! | - | No description provided |
| packageManager | String | - | No description provided |
| exposedPort | Integer | - | No description provided |
Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
build-next --repository string --framework stringfunc (m *MyModule) Example(repository string, framework string) *dagger.Container {
return dag.
Build().
BuildNext(repository, framework)
}@function
def example(repository: str, framework: str) -> dagger.Container:
return (
dag.build()
.build_next(repository, framework)
)@func()
example(repository: string, framework: string): Container {
return dag
.build()
.buildNext(repository, framework)
}buildNginx() 🔗
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| jobAttempt | String | - | No description provided |
| repository | String ! | - | No description provided |
| ref | String | - | No description provided |
| path | String | - | No description provided |
| job | String | - | No description provided |
| framework | String ! | - | No description provided |
| packageManager | String | - | No description provided |
| exposedPort | Integer | - | No description provided |
Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
build-nginx --repository string --framework stringfunc (m *MyModule) Example(repository string, framework string) *dagger.Container {
return dag.
Build().
BuildNginx(repository, framework)
}@function
def example(repository: str, framework: str) -> dagger.Container:
return (
dag.build()
.build_nginx(repository, framework)
)@func()
example(repository: string, framework: string): Container {
return dag
.build()
.buildNginx(repository, framework)
}npmBuild() 🔗
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| jobAttempt | String | - | No description provided |
| repository | String ! | - | No description provided |
| ref | String | - | No description provided |
| path | String | - | No description provided |
| job | String | - | No description provided |
| packageManager | String | - | No description provided |
Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
npm-build --repository stringfunc (m *MyModule) Example(repository string) *dagger.Container {
return dag.
Build().
NpmBuild(repository)
}@function
def example(repository: str) -> dagger.Container:
return (
dag.build()
.npm_build(repository)
)@func()
example(repository: string): Container {
return dag
.build()
.npmBuild(repository)
}npmInstall() 🔗
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| jobAttempt | String ! | - | No description provided |
| job | String ! | - | No description provided |
| packageManager | String ! | - | No description provided |
Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
npm-install --source DIR_PATH --job-attempt string --job string --package-manager stringfunc (m *MyModule) Example(source *dagger.Directory, jobAttempt string, job string, packageManager string) *dagger.Container {
return dag.
Build().
NpmInstall(source, jobAttempt, job, packageManager)
}@function
def example(source: dagger.Directory, job_attempt: str, job: str, package_manager: str) -> dagger.Container:
return (
dag.build()
.npm_install(source, job_attempt, job, package_manager)
)@func()
example(source: Directory, jobAttempt: string, job: string, packageManager: string): Container {
return dag
.build()
.npmInstall(source, jobAttempt, job, packageManager)
}publish() 🔗
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| jobAttempt | String | - | No description provided |
| repository | String ! | - | No description provided |
| ref | String | - | No description provided |
| path | String | - | No description provided |
| job | String | - | No description provided |
| framework | String ! | - | No description provided |
| packageManager | String | - | No description provided |
| exposedPort | Integer | - | No description provided |
| imageName | String ! | - | Image name for the registry (e.g. project ID) |
| commitHash | String ! | - | Commit hash used as the image tag |
| registryUrl | String ! | - | Registry URL (e.g. 192.168.1.150:30082) |
| registryUser | String ! | - | Registry username |
| registryPassword | Secret ! | - | Registry password |
Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
publish --repository string --framework string --image-name string --commit-hash string --registry-url string --registry-user string --registry-password env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, repository string, framework string, imageName string, commitHash string, registryUrl string, registryUser string, registryPassword *dagger.Secret) string {
return dag.
Build().
Publish(ctxrepository, framework, imageName, commitHash, registryUrl, registryUser, registryPassword)
}@function
async def example(repository: str, framework: str, image_name: str, commit_hash: str, registry_url: str, registry_user: str, registry_password: dagger.Secret) -> str:
return await (
dag.build()
.publish(repository, framework, image_name, commit_hash, registry_url, registry_user, registry_password)
)@func()
async example(repository: string, framework: string, imageName: string, commitHash: string, registryUrl: string, registryUser: string, registryPassword: Secret): Promise<string> {
return dag
.build()
.publish(repository, framework, imageName, commitHash, registryUrl, registryUser, registryPassword)
}test() 🔗
Return Type
Container ! Example
dagger -m github.com/antonkad/build-image@bbe96bec635d7592889b9b178f89e8ad7e2da73a call \
testfunc (m *MyModule) Example() *dagger.Container {
return dag.
Build().
Test()
}@function
def example() -> dagger.Container:
return (
dag.build()
.test()
)@func()
example(): Container {
return dag
.build()
.test()
}