-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(service): remove image name suppress function * feat: add docker image data-source * docs(service): add example for iamge datasource usage * fix: image repo digest with tag determination * fix: always return a repoDigest * fix(image): deprecation notice for latest attribute * fix(ci): explicitly go get tfplugindocs * fix(ci): remove gocenter.io proxy
- Loading branch information
Showing
40 changed files
with
650 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "docker_image Data Source - terraform-provider-docker" | ||
subcategory: "" | ||
description: |- | ||
docker_image provides details about a specific Docker Image which need to be presend on the Docker Host | ||
--- | ||
|
||
# docker_image (Data Source) | ||
|
||
`docker_image` provides details about a specific Docker Image which need to be presend on the Docker Host | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
# uses the 'latest' tag | ||
data "docker_image" "latest" { | ||
name = "nginx" | ||
} | ||
# uses a specific tag | ||
data "docker_image" "specific" { | ||
name = "nginx:1.17.6" | ||
} | ||
# use the image digest | ||
data "docker_image" "digest" { | ||
name = "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2" | ||
} | ||
# uses the tag and the image digest | ||
data "docker_image" "tag_and_digest" { | ||
name = "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- **name** (String) The name of the Docker image, including any tags or SHA256 repo digests. | ||
|
||
### Optional | ||
|
||
- **id** (String) The ID of this resource. | ||
|
||
### Read-Only | ||
|
||
- **repo_digest** (String) The image sha256 digest in the form of `repo[:tag]@sha256:<hash>`. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# uses the 'latest' tag | ||
data "docker_image" "latest" { | ||
name = "nginx" | ||
} | ||
|
||
# uses a specific tag | ||
data "docker_image" "specific" { | ||
name = "nginx:1.17.6" | ||
} | ||
|
||
# use the image digest | ||
data "docker_image" "digest" { | ||
name = "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2" | ||
} | ||
|
||
# uses the tag and the image digest | ||
data "docker_image" "tag_and_digest" { | ||
name = "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2" | ||
} |
19 changes: 19 additions & 0 deletions
19
examples/resources/docker_service/resource-basic-image-ds.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
data "docker_image" "foo" { | ||
name = "repo.mycompany.com:8080/foo-service:v1" | ||
} | ||
|
||
resource "docker_service" "foo" { | ||
name = "foo-service" | ||
|
||
task_spec { | ||
container_spec { | ||
image = data.docker_image.foo.repo_digest | ||
} | ||
} | ||
|
||
endpoint_spec { | ||
ports { | ||
target_port = "8080" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.