Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add migration guide and update README #502

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,11 @@
[![Lint Status](https://github.com/kreuzwerker/terraform-provider-docker/workflows/golangci-lint/badge.svg)](https://github.com/kreuzwerker/terraform-provider-docker/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/kreuzwerker/terraform-provider-docker)](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 [email protected]: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

Expand Down Expand Up @@ -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 [email protected]:kreuzwerker/terraform-provider-docker
$ make build
```

## Contributing

The Terraform Docker Provider is the work of many of contributors. We appreciate your help!
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_docker_registry_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
47 changes: 47 additions & 0 deletions templates/v2_v3_migration.md
Original file line number Diff line number Diff line change
@@ -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
}
```