mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-20 22:59:42 -05:00
docs: Add migration guide and update README (#502)
This commit is contained in:
parent
59d265802a
commit
0f65e0577a
3 changed files with 62 additions and 14 deletions
25
README.md
25
README.md
|
|
@ -18,20 +18,11 @@
|
|||
[](https://github.com/kreuzwerker/terraform-provider-docker/actions)
|
||||
[](https://goreportcard.com/report/github.com/kreuzwerker/terraform-provider-docker)
|
||||
|
||||
- Website: https://www.terraform.io
|
||||
- Provider: [kreuzwerker/docker](https://registry.terraform.io/providers/kreuzwerker/docker/latest)
|
||||
- Slack: [@gophers/terraform-provider-docker](https://gophers.slack.com/archives/C01G9TN5V36)
|
||||
## Documentation
|
||||
|
||||
## Requirements
|
||||
- [Terraform](https://www.terraform.io/downloads.html) >=0.12.x
|
||||
- [Go](https://golang.org/doc/install) 1.18.x (to build the provider plugin)
|
||||
The documentation for the provider is available on the [Terraform Registry](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs).
|
||||
|
||||
## Building The Provider
|
||||
|
||||
```sh
|
||||
$ git clone git@github.com:kreuzwerker/terraform-provider-docker
|
||||
$ make build
|
||||
```
|
||||
Do you want to migrate from `v2.x` to `v3.x`? Please read the [migration guide](docs/v2_v3_migration.md)
|
||||
|
||||
## Example usage
|
||||
|
||||
|
|
@ -100,6 +91,16 @@ resource "docker_service" "nginx_service" {
|
|||
}
|
||||
```
|
||||
|
||||
## Building The Provider
|
||||
|
||||
[Go](https://golang.org/doc/install) 1.18.x (to build the provider plugin)
|
||||
|
||||
|
||||
```sh
|
||||
$ git clone git@github.com:kreuzwerker/terraform-provider-docker
|
||||
$ make build
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
The Terraform Docker Provider is the work of many of contributors. We appreciate your help!
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ func resourceDockerRegistryImage() *schema.Resource {
|
|||
|
||||
"build": {
|
||||
Type: schema.TypeList,
|
||||
Description: "Definition for building the image",
|
||||
Description: "This field is deprecated. Use the `build` block of the `docker_image` resource instead. This field will be removed in the next major release.",
|
||||
Optional: true,
|
||||
MaxItems: 1,
|
||||
Deprecated: "Use `docker_image` resource instead. This field will be removed in the next major release.",
|
||||
Deprecated: "Use the build block fo the `docker_image` resource instead. This field will be removed in the next major release.",
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"suppress_output": {
|
||||
|
|
|
|||
47
templates/v2_v3_migration.md
Normal file
47
templates/v2_v3_migration.md
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# V2 to V3 Migration Guide
|
||||
|
||||
This guide is intended to help you migrate from V2 to V3 of the `terraform-provider-docker`.
|
||||
|
||||
The in the past minor versions there were many new attributes and older attributes are deprecated.
|
||||
|
||||
This will give you an overview over which attributes are deprecated and which attributes you should use instead.
|
||||
|
||||
## `docker_container`
|
||||
|
||||
|
||||
Deprecated attributes:
|
||||
* `links`: The --link flag is a legacy feature of Docker and will be removed (https://docs.docker.com/network/links/)
|
||||
* `ip_address`, `ip_prefix_length`, `gateway`: Use the `network_data` block instead
|
||||
* `network_alias`, `networks`: Use the `networks_addvanced` block instead
|
||||
|
||||
|
||||
## `docker_image`
|
||||
|
||||
* `latest`: Use `repo_digest` instead
|
||||
* `pull_trigger`: Use `pull_triggers` instead
|
||||
* `output`: Unused and will be removed
|
||||
* `build.path`: Use `build.context` instead
|
||||
|
||||
## `docker_service`
|
||||
|
||||
* `networks`: Use the `networks_addvanced` block instead
|
||||
|
||||
|
||||
## `docker_registry_image`
|
||||
|
||||
The whole `build` block will be removed. Use the `build` block of the `docker_image` resource instead.
|
||||
In order to push images to an registry, still use `docker_registry_image` and reference the `docker_image` resource:
|
||||
|
||||
```hcl
|
||||
resource "docker_image" "foo_image" {
|
||||
provider = "docker.private"
|
||||
name = "somename"
|
||||
build {
|
||||
// your build params
|
||||
}
|
||||
}
|
||||
|
||||
resource "docker_registry_image" "foo" {
|
||||
name = docker_image.foo_image.name
|
||||
}
|
||||
```
|
||||
Loading…
Reference in a new issue