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@19651c1b7f8e6582f53477827d4608fc02f58630Entrypoint
Return Type
ContainerImage Example
dagger -m github.com/dictybase-docker/dagger-of-dcr/container-image@19651c1b7f8e6582f53477827d4608fc02f58630 call \
func (m *MyModule) Example() *dagger.ContainerImage {
return dag.
ContainerImage()
}@function
def example() -> dagger.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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
repositoryfunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
reffunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
namespacefunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
dockerfilefunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
imagefunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
docker-image-tagfunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
with-namespace --namespace stringfunc (m *MyModule) Example(namespace string) *dagger.ContainerImage {
return dag.
ContainerImage().
WithNamespace(namespace)
}@function
def example(namespace: str) -> dagger.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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
with-ref --ref stringfunc (m *MyModule) Example(ref string) *dagger.ContainerImage {
return dag.
ContainerImage().
WithRef(ref)
}@function
def example(ref: str) -> dagger.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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
with-repository --repository stringfunc (m *MyModule) Example(repository string) *dagger.ContainerImage {
return dag.
ContainerImage().
WithRepository(repository)
}@function
def example(repository: str) -> dagger.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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
with-dockerfilefunc (m *MyModule) Example() *dagger.ContainerImage {
return dag.
ContainerImage().
WithDockerfile()
}@function
def example() -> dagger.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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
with-image --image stringfunc (m *MyModule) Example(image string) *dagger.ContainerImage {
return dag.
ContainerImage().
WithImage(image)
}@function
def example(image: str) -> dagger.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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
publish-from-repo --user string --password stringfunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
fake-publish-from-repofunc (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@19651c1b7f8e6582f53477827d4608fc02f58630 call \
image-tagfunc (m *MyModule) Example() *dagger.Container {
return dag.
ContainerImage().
ImageTag()
}@function
def example() -> dagger.Container:
return (
dag.container_image()
.image_tag()
)@func()
example(): Container {
return dag
.containerImage()
.imageTag()
}