container-image
It includes methods to set various properties of the container image and generate appropriate Docker image tags.Installation
dagger install github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a
Entrypoint
Return Type
ContainerImage
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
func (m *myModule) example() *ContainerImage {
return dag.
ContainerImage()
}
@function
def example() -> dag.ContainerImage:
return (
dag.container_image()
)
@func()
example(): ContainerImage {
return dag
.containerImage()
}
Types
ContainerImage 🔗
repository() 🔗
Repository name
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
repository
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
Repository(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.repository()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.repository()
}
ref() 🔗
Git reference
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
ref
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
Ref(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.ref()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.ref()
}
namespace() 🔗
The docker namespace under which the image will be pushed
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
namespace
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
Namespace(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.namespace()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.namespace()
}
dockerfile() 🔗
Specifies the path to the Dockerfile
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
dockerfile
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
Dockerfile(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.dockerfile()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.dockerfile()
}
image() 🔗
Name of the image to be built
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
image
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
Image(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.image()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.image()
}
dockerImageTag() 🔗
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
docker-image-tag
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
DockerImageTag(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.docker_image_tag()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.dockerImageTag()
}
withNamespace() 🔗
WithNamespace sets the docker namespace
Return Type
ContainerImage !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
namespace | String ! | "dictybase" | The docker namespace under which the image will be pushed |
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
with-namespace --namespace string
func (m *myModule) example(namespace string) *ContainerImage {
return dag.
ContainerImage().
WithNamespace(namespace)
}
@function
def example(namespace: str) -> dag.ContainerImage:
return (
dag.container_image()
.with_namespace(namespace)
)
@func()
example(namespace: string): ContainerImage {
return dag
.containerImage()
.withNamespace(namespace)
}
withRef() 🔗
WithRef sets the Git reference (branch, tag, or SHA)
Return Type
ContainerImage !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ref | String ! | - | the branch, tag or sha to checkout |
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
with-ref --ref string
func (m *myModule) example(ref string) *ContainerImage {
return dag.
ContainerImage().
WithRef(ref)
}
@function
def example(ref: str) -> dag.ContainerImage:
return (
dag.container_image()
.with_ref(ref)
)
@func()
example(ref: string): ContainerImage {
return dag
.containerImage()
.withRef(ref)
}
withRepository() 🔗
WithRepository sets the GitHub repository name
Return Type
ContainerImage !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | github repository name with owner, for example tora/bora, Required |
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
with-repository --repository string
func (m *myModule) example(repository string) *ContainerImage {
return dag.
ContainerImage().
WithRepository(repository)
}
@function
def example(repository: str) -> dag.ContainerImage:
return (
dag.container_image()
.with_repository(repository)
)
@func()
example(repository: string): ContainerImage {
return dag
.containerImage()
.withRepository(repository)
}
withDockerfile() 🔗
WithDockerfile sets the Dockerfile path
Return Type
ContainerImage !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
dockerFile | String | "build/package/Dockerfile" | specifies the path to the Dockerfile |
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
with-dockerfile
func (m *myModule) example() *ContainerImage {
return dag.
ContainerImage().
WithDockerfile()
}
@function
def example() -> dag.ContainerImage:
return (
dag.container_image()
.with_dockerfile()
)
@func()
example(): ContainerImage {
return dag
.containerImage()
.withDockerfile()
}
withImage() 🔗
WithImage sets the image name
Return Type
ContainerImage !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | name of the image to be built |
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
with-image --image string
func (m *myModule) example(image string) *ContainerImage {
return dag.
ContainerImage().
WithImage(image)
}
@function
def example(image: str) -> dag.ContainerImage:
return (
dag.container_image()
.with_image(image)
)
@func()
example(image: string): ContainerImage {
return dag
.containerImage()
.withImage(image)
}
publishFromRepo() 🔗
PublishFromRepo publishes a container image to Docker Hub
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
user | String ! | - | dockerhub user name |
password | String ! | - | dockerhub password, use an api token |
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
publish-from-repo --user string --password string
func (m *myModule) example(ctx context.Context, user string, password string) string {
return dag.
ContainerImage().
PublishFromRepo(ctx, user, password)
}
@function
async def example(user: str, password: str) -> str:
return await (
dag.container_image()
.publish_from_repo(user, password)
)
@func()
async example(user: string, password: string): Promise<string> {
return dag
.containerImage()
.publishFromRepo(user, password)
}
fakePublishFromRepo() 🔗
FakePublishFromRepo publishes a container image to a temporary repository with a time-to-live of 10 minutes.
Return Type
String !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
fake-publish-from-repo
func (m *myModule) example(ctx context.Context) string {
return dag.
ContainerImage().
FakePublishFromRepo(ctx)
}
@function
async def example() -> str:
return await (
dag.container_image()
.fake_publish_from_repo()
)
@func()
async example(): Promise<string> {
return dag
.containerImage()
.fakePublishFromRepo()
}
imageTag() 🔗
ImageTag generates a Docker image tag based on the provided Git reference
Return Type
Container !
Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@c345521a07590bc77a0680c988607d1fe93cf24a call \
image-tag
func (m *myModule) example() *Container {
return dag.
ContainerImage().
ImageTag()
}
@function
def example() -> dagger.Container:
return (
dag.container_image()
.image_tag()
)
@func()
example(): Container {
return dag
.containerImage()
.imageTag()
}