Dagger
Search

image

This module has been generated via dagger init and serves as a reference to
basic 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
NameTypeDefault ValueDescription
baseHadolintContainerContainer -base hadolint container It need contain hadolint
buildContainerContainer -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
NameTypeDefault ValueDescription
sourceDirectory !-the source directory
dockerfileString "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
NameTypeDefault ValueDescription
sourceDirectory !-the source directory
dockerfileString -The dockerfile path
thresholdString -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
NameTypeDefault ValueDescription
repositoryNameString !-The repository name
versionString !-The version
withRegistryUsernameSecret -The registry username
withRegistryPasswordSecret -The registry password
registryUrlString !-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)
}