image
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/disaster37/dagger-library-go/image@v0.0.24
Entrypoint
Return Type
Image !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
baseHadolintContainer | Container | - | base hadolint container It need contain hadolint |
buildContainer | Container | - | The external build of container Usefull when need build args |
Example
dagger -m github.com/disaster37/dagger-library-go/image@2d35aed06292796c4d2351b6336caa1f37247f7b call \
func (m *myModule) example() *Image {
return dag.
Image()
}
@function
def example() -> dag.Image:
return (
dag.image()
)
@func()
example(): Image {
return dag
.image()
}
Types
Image 🔗
getBaseHadolintContainer() 🔗
GetBaseHadolintContainer return the default image for hadolint
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/image@2d35aed06292796c4d2351b6336caa1f37247f7b call \
get-base-hadolint-container
func (m *myModule) example() *Container {
return dag.
Image().
GetBaseHadolintContainer()
}
@function
def example() -> dagger.Container:
return (
dag.image()
.get_base_hadolint_container()
)
@func()
example(): Container {
return dag
.image()
.getBaseHadolintContainer()
}
build() 🔗
Build permit to build image from Dockerfile
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | the source directory |
dockerfile | String | "Dockerfile" | The dockerfile path |
withDirectories | [Directory ! ] | - | Set extra directories |
Example
dagger -m github.com/disaster37/dagger-library-go/image@2d35aed06292796c4d2351b6336caa1f37247f7b call \
build --source DIR_PATH
func (m *myModule) example(source *Directory) *ImageBuild {
return dag.
Image().
Build(source)
}
@function
def example(source: dagger.Directory) -> dag.ImageBuild:
return (
dag.image()
.build(source)
)
@func()
example(source: Directory): ImageBuild {
return dag
.image()
.build(source)
}
lint() 🔗
Lint permit to lint dockerfile image
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | the source directory |
dockerfile | String | - | The dockerfile path |
threshold | String | - | The failure threshold |
Example
dagger -m github.com/disaster37/dagger-library-go/image@2d35aed06292796c4d2351b6336caa1f37247f7b call \
lint --source DIR_PATH
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Image().
Lint(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
return await (
dag.image()
.lint(source)
)
@func()
async example(source: Directory): Promise<string> {
return dag
.image()
.lint(source)
}
Build 🔗
getContainer() 🔗
GetContainer permit to get the container
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/image@2d35aed06292796c4d2351b6336caa1f37247f7b call \
build --source DIR_PATH \
get-container
func (m *myModule) example(source *Directory) *Container {
return dag.
Image().
Build(source).
GetContainer()
}
@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.image()
.build(source)
.get_container()
)
@func()
example(source: Directory): Container {
return dag
.image()
.build(source)
.getContainer()
}
push() 🔗
Push permit to push image
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repositoryName | String ! | - | The repository name |
version | String ! | - | The version |
withRegistryUsername | Secret | - | The registry username |
withRegistryPassword | Secret | - | The registry password |
registryUrl | String ! | - | The registry url |
Example
dagger -m github.com/disaster37/dagger-library-go/image@2d35aed06292796c4d2351b6336caa1f37247f7b call \
build --source DIR_PATH \
push --repository-name string --version string --registry-url string
func (m *myModule) example(ctx context.Context, source *Directory, repositoryName string, version string, registryUrl string) string {
return dag.
Image().
Build(source).
Push(ctx, repositoryName, version, registryUrl)
}
@function
async def example(source: dagger.Directory, repository_name: str, version: str, registry_url: str) -> str:
return await (
dag.image()
.build(source)
.push(repository_name, version, registry_url)
)
@func()
async example(source: Directory, repositoryName: string, version: string, registryUrl: string): Promise<string> {
return dag
.image()
.build(source)
.push(repositoryName, version, registryUrl)
}